<html><head><meta charset="UTF-8" /><script>var $gwt_version = "2.3.0";var $wnd = parent;var $doc = $wnd.document;var $moduleName, $moduleBase;var $strongName = '9EC6759B8761299A1A934AAC45DEBDD0';var $stats = $wnd.__gwtStatsEvent ? function(a) {return $wnd.__gwtStatsEvent(a);} : null,$sessionId = $wnd.__gwtStatsSessionId ? $wnd.__gwtStatsSessionId : null;$stats && $stats({moduleName:'sandbox',sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'});</script></head><body><script><!--
function v(){}
function u(){}
function C(){}
function K(){}
function J(){}
function I(){}
function H(){}
function Hb(){}
function cb(){}
function pb(){}
function kb(){}
function Cb(){}
function xb(){}
function Ib(){}
function Qb(){}
function Wb(){}
function Zb(){}
function Yb(){}
function AA(){}
function rc(){}
function qc(){}
function Ec(){}
function Hc(){}
function Kc(){}
function Nc(){}
function Qc(){}
function cd(){}
function fd(){}
function id(){}
function ld(){}
function od(){}
function rd(){}
function ud(){}
function xd(){}
function Ad(){}
function Id(){}
function Hd(){}
function Gd(){}
function Fd(){}
function Ed(){}
function Vd(){}
function Dd(){}
function _d(){}
function $d(){}
function Zd(){}
function le(){}
function ie(){}
function se(){}
function pe(){}
function ze(){}
function we(){}
function De(){}
function He(){}
function Me(){}
function Ge(){}
function Te(){}
function Qe(){}
function Xe(){}
function $e(){}
function bf(){}
function jf(){}
function ff(){}
function pf(){}
function nf(){}
function wf(){}
function uf(){}
function Ef(){}
function Bf(){}
function Jf(){}
function Rf(){}
function Qf(){}
function Pf(){}
function eg(){}
function ig(){}
function hg(){}
function qg(){}
function Ag(){}
function zg(){}
function al(){}
function el(){}
function dl(){}
function kl(){}
function ol(){}
function sl(){}
function yl(){}
function xl(){}
function wl(){}
function Ml(){}
function Vl(){}
function Ql(){}
function _l(){}
function _k(){}
function am(){}
function Nm(){}
function Rm(){}
function Ym(){}
function Yl(){}
function $l(){}
function Zl(){}
function Xl(){}
function Xm(){}
function hn(){}
function mn(){}
function rn(){}
function qn(){}
function un(){}
function yn(){}
function Cn(){}
function Rn(){}
function Qn(){}
function fo(){}
function po(){}
function oo(){}
function vo(){}
function Mo(){}
function Lo(){}
function Ro(){}
function Vo(){}
function Uo(){}
function $o(){}
function Zo(){}
function dp(){}
function cp(){}
function pp(){}
function op(){}
function up(){}
function tp(){}
function zp(){}
function yp(){}
function Ep(){}
function Dp(){}
function Pp(){}
function Mp(){}
function Rp(){}
function Up(){}
function cq(){}
function rq(){}
function uq(){}
function xq(){}
function Aq(){}
function Dq(){}
function Hq(){}
function Mq(){}
function Sq(){}
function Qq(){}
function gr(){}
function cr(){}
function Cr(){}
function Lr(){}
function Zr(){}
function fs(){}
function es(){}
function ns(){}
function ms(){}
function Cs(){}
function Ks(){}
function Js(){}
function Os(){}
function Ns(){}
function Ts(){}
function Ss(){}
function Rs(){}
function Zs(){}
function at(){}
function gt(){}
function ft(){}
function et(){}
function zt(){}
function yt(){}
function Bt(){}
function Jt(){}
function Mt(){}
function Ut(){}
function St(){}
function Xt(){}
function _t(){}
function cu(){}
function ju(){}
function uu(){}
function tu(){}
function yu(){}
function xu(){}
function Au(){}
function Gu(){}
function Eu(){}
function Iu(){}
function Pu(){}
function Uu(){}
function bv(){}
function iv(){}
function mv(){}
function qv(){}
function uv(){}
function xv(){}
function Hv(){}
function Gv(){}
function Nv(){}
function Qv(){}
function Tv(){}
function Xv(){}
function cw(){}
function iw(){}
function Fw(){}
function Lw(){}
function Rw(){}
function Uw(){}
function dx(){}
function cx(){}
function Cx(){}
function Bx(){}
function Nx(){}
function Wx(){}
function Vx(){}
function Vy(){}
function ey(){}
function ky(){}
function wy(){}
function Fy(){}
function Jy(){}
function Py(){}
function oz(){}
function nz(){}
function tz(){}
function Fz(){}
function Jz(){}
function Uz(){}
function $z(){}
function cA(){}
function jA(){}
function mA(){}
function tA(){}
function sA(){}
function xA(){}
function wA(){}
function Nn(){Mn()}
function Fr(){Er()}
function vv(){zb(this)}
function Ov(){zb(this)}
function Uv(){zb(this)}
function Yv(){zb(this)}
function dw(){zb(this)}
function _z(){zb(this)}
function Hz(){lx(this)}
function kc(){return 0}
function lc(){return 0}
function Ee(){this.b={}}
function Eq(b){this.b=b}
function sq(b){this.b=b}
function vq(b){this.b=b}
function yq(b){this.b=b}
function Bq(b){this.b=b}
function Nq(b){this.b=b}
function fg(b){this.b=b}
function Ol(b){this.b=b}
function zn(b){this.b=b}
function Ct(b){this.b=b}
function Kt(b){this.b=b}
function Yt(b){this.b=b}
function au(b){this.b=b}
function hu(b){this.b=b}
function Bv(b){this.b=b}
function dv(b){this.c=b}
function Hx(b){this.b=b}
function _x(b){this.b=b}
function Qy(b){this.b=b}
function Ay(b){this.e=b}
function ee(){this.d=++ae}
function Gl(){this.b=true}
function Hw(){this.b=new Zb}
function Nw(){this.b=new Zb}
function Lz(){this.b=new Hz}
function qo(){qo=AA;new mo}
function mb(){mb=AA;lb=new pb}
function Dc(){Bc();return wc}
function bd(){_c();return Rc}
function yg(){vg();return rg}
function Do(){Ao();return wo}
function qb(b){return Iq(b)}
function ht(b,c){b.b=c;it(b)}
function _m(b,c){b.z[tB]=c}
function lo(b,c){!!c&&(b.e=c)}
function ts(b,c){os(b,c,b.z)}
function Vu(b,c){Xu(b,c,b.d)}
function _q(b,c){Qr();Yr(b,c)}
function $q(b){Wq=b;Qr();Sr=b}
function Df(b){b.b.f&&Cm(b.b)}
function bw(b){return 0>b?0:b}
function lg(b){jg.call(this,b)}
function Jp(){Jp=AA;lp=new up}
function Ip(){Ip=AA;kp=new pp}
function Kp(){Kp=AA;mp=new zp}
function Lp(){Lp=AA;np=new Ep}
function Kl(){Kl=AA;Jl=new Vl}
function Er(){Er=AA;Dr=new ee}
function rt(){rt=AA;qt=new zt}
function mz(){mz=AA;lz=new oz}
function vz(){this.b=new Date}
function Vv(b){zb(this);this.g=b}
function Zv(b){zb(this);this.g=b}
function ew(b){zb(this);this.g=b}
function Sw(b){zb(this);this.g=b}
function Gs(b){jg.call(this,b)}
function jv(b){b.b.P(b.e,b.d,b.c)}
function fm(b,c){!!b.x&&Kf(b.x,c)}
function Rq(b,c,d){b.b=c;b.c=d}
function Bw(){Bw=AA;yw={};Aw={}}
function aw(b){return b<=0?0-b:b}
function Vk(b){return b.l|b.m<<22}
function wg(b,c){this.b=b;this.c=c}
function Om(b,c){this.b=b;this.c=c}
function Bo(b,c){this.b=b;this.c=c}
function Yp(b,c){this.b=b;this.c=c}
function Tq(b,c){this.b=b;this.c=c}
function dd(){this.b='PX';this.c=0}
function md(){this.b='EX';this.c=3}
function jd(){this.b='EM';this.c=2}
function yd(){this.b='CM';this.c=7}
function Bd(){this.b='MM';this.c=8}
function pd(){this.b='PT';this.c=4}
function sd(){this.b='PC';this.c=5}
function gd(){this.b='PCT';this.c=1}
function vd(){this.b='IN';this.c=6}
function Ky(b,c){this.b=b;this.c=c}
function Vz(b,c){this.b=b;this.c=c}
function fy(b,c){this.c=b;this.b=c}
function Fc(){this.b='NONE';this.c=0}
function is(){this.b=new Lf(null)}
function Gw(b,c){b.b.b+=c;return b}
function Mw(b,c){b.b.b+=c;return b}
function dn(b,c,d){en(b,b.c+c,b.b+d)}
function Mg(b,c){return b.cM&&b.cM[c]}
function xy(b){return b.c<b.e.sb()}
function qx(c,b){return JA+b in c.f}
function Az(b){return b<10?SB+b:EA+b}
function Zp(b){Yp.call(this,b.b,b.c)}
function Bu(){ou.call(this,$doc.body)}
function yr(){if(!qr){ks();qr=true}}
function zr(){if(!ur){ls();ur=true}}
function Qr(){if(!Or){Xr();Or=true}}
function Ic(){this.b='BLOCK';this.c=1}
function Lc(){this.b='INLINE';this.c=2}
function bg(b){this.e=new Hz;this.d=b}
function wz(b){this.b=new Date(Uk(b))}
function E(){this.b=(new Date).getTime()}
function mo(){this.f=true;this.b=new az}
function Fs(){Fs=AA;Ds=new Ks;Es=new Os}
function Ud(){Ud=AA;Td=new ge(TA,new Vd)}
function ke(){ke=AA;je=new ge(UA,new le)}
function re(){re=AA;qe=new ge(VA,new se)}
function ye(){ye=AA;xe=new ge(WA,new ze)}
function Le(){Le=AA;Ke=new ge(XA,new Me)}
function Se(){Se=AA;Re=new ge(YA,new Te)}
function af(){af=AA;_e=new ge($A,new bf)}
function hf(){hf=AA;gf=new ge(_A,new jf)}
function Iw(b){this.b=new Zb;this.b.b+=b}
function Ow(b){this.b=new Zb;this.b.b+=b}
function jn(b,c){this.b=b;Sm.call(this,c)}
function nn(b,c){this.b=b;Sm.call(this,c)}
function ny(b,c){(b<0||b>=c)&&ry(b,c)}
function mq(b,c){b.f=c;!c&&(b.g=null)}
function io(b,c){return go(b).b.c<=c.b.c}
function $(b){return Qg(b)?Ab(Og(b)):EA}
function V(b){return Qg(b)?W(Og(b)):b+EA}
function Ox(b){return b.c=Ng(yy(b.b),49)}
function Z(b){return b==null?null:b.name}
function W(b){return b==null?null:b.message}
function gb(b,c,d){return b.apply(c,d);var e}
function Vf(b,c,d){var e;e=Yf(b,c);e.ob(d)}
function ws(b,c,d,e){us(b,c);b.ib(c,d,e)}
function az(){this.b=Eg(Dk,{44:1},0,0,0)}
function Ku(b){this.d=b;this.b=!!this.d.u}
function Mf(b,c){this.b=new bg(c);this.c=b}
function Lf(b){this.b=new bg(false);this.c=b}
function Oc(){this.b='INLINE_BLOCK';this.c=3}
function ro(b){qo();this.b=new mo;this.b.d=b}
function to(b){qo();this.b=new mo;this.b.d=b}
function rf(b){var c;if(of){c=new pf;b.O(c)}}
function us(b,c){if(c.y!=b){throw new Rv}}
function Wy(b,c){Gg(b.b,b.c++,c);return true}
function Nl(b,c){jo(b.b.b,(_n(),Zn),c.A(),c)}
function Tf(b,c){!b.b&&(b.b=new az);Wy(b.b,c)}
function yf(b){var c;if(vf){c=new wf;Kf(b,c)}}
function jt(b){this.z=b;this.c=new ct(this.z)}
function nv(b,c,d){this.b=b;this.d=c;this.c=d}
function rv(b,c,d){this.b=b;this.d=c;this.c=d}
function Mr(){this.b=new bg(false);this.c=null}
function fq(b){b.o=false;b.c=false;b.g=null}
function or(b){nr();return mr?_r(mr,b):null}
function qw(c,b){return c.substr(b,c.length-b)}
function Vp(b,c){return new Yp(b.b-c.b,b.c-c.c)}
function Wp(b,c){return new Yp(b.b*c.b,b.c*c.c)}
function Xp(b,c){return new Yp(b.b+c.b,b.c+c.c)}
function D(b){return (new Date).getTime()-b.b}
function Pg(b,c){return b!=null&&b.cM&&!!b.cM[c]}
function Xy(b){b.b=Eg(Dk,{44:1},0,0,0);b.c=0}
function Gf(b){var c;if(Cf){c=new Ef;Kf(b.b,c)}}
function Jv(b,c){var d;d=new Hv;d.c=b+c;return d}
function sb(b,c){!b&&(b=[]);b[b.length]=c;return b}
function Bb(){try{null.a()}catch(b){return b}}
function fl(b){if(b.d){return b.d}return _n(),Sn}
function hl(){this.c=new zn(true);this.d=(_n(),Sn)}
function pl(){this.c=new zn(true);this.d=(_n(),Sn)}
function vn(){this.c=new zn(true);this.d=(_n(),Sn)}
function ct(b){this.b=b;this.c=og(b);this.d=this.c}
function jw(b){this.b='Unknown';this.d=b;this.c=-1}
function T(b){zb(this);this.c=b;yb(new Qb,this)}
function Jg(){Jg=AA;Hg=[];Ig=[];Kg(new Ag,Hg,Ig)}
function qA(){qA=AA;pA=(qo(),ho('Sandbox'))}
function Ho(){Ho=AA;Go=(qo(),ho(xB));Eo=Ik()}
function nr(){nr=AA;mr=new is;gs(mr)||(mr=null)}
function nu(){nu=AA;ku=new uu;lu=new Hz;mu=new Lz}
function ex(b){var c;c=new Hx(b);return new Ky(b,c)}
function Kz(b,c){var d;d=rx(b.b,c,b);return d==null}
function wb(b,c){b.length>=c&&b.splice(0,c);return b}
function vs(b,c){var d;d=ps(b,c);d&&ys(c.z);return d}
function Rg(b){if(b!=null){throw new Ov}return null}
function go(b){if(b.c){return b.c}return go(b.e.b)}
function vr(b){yr();return wr(of?of:(of=new ee),b)}
function Av(){Av=AA;yv=new Bv(false);zv=new Bv(true)}
function ll(){this.c=new zn(false);this.d=(_n(),Sn)}
function tl(b){this.b=b;this.c=new Gl;this.d=(_n(),Sn)}
function $u(b){this.c=b;this.b=Eg(Ck,{44:1},26,4,0)}
function mt(b){jt.call(this,b,nw('span',b.tagName))}
function ou(b){this.g=new $u(this);this.z=b;gm(this)}
function Iv(b,c){var d;d=new Hv;d.c=b+c;d.b=4;return d}
function Mk(b,c,d){return a=new al,a.l=b,a.m=c,a.h=d,a}
function Wk(b,c){return Mk(b.l^c.l,b.m^c.m,b.h^c.h)}
function Pk(b,c){return b.l==c.l&&b.m==c.m&&b.h==c.h}
function Rr(b){return !Qg(b)&&b!=null&&b.cM&&!!b.cM[25]}
function Fu(b){return (b.scrollWidth||0)-b.clientWidth}
function Nk(b){return b.l+b.m*4194304+b.h*17592186044416}
function lx(b){b.b=[];b.f={};b.d=false;b.c=null;b.e=0}
function kv(b,c,d){this.b=b;this.e=c;this.d=null;this.c=d}
function co(b,c){_n();this.b=new Nn;this.b.b=b;this.b.c=c}
function Sp(b,c){this.d=c;this.e=new Zp(b);this.f=new Zp(c)}
function ry(b,c){throw new Zv('Index: '+b+', Size: '+c)}
function Km(b,c){Qu(b.b,c);_m(b.d,b.d.z.scrollHeight||0)}
function Cm(b){if(!b.s){return}gu(b.r,false,false);rf(b)}
function xr(b){yr();zr();return wr((!vf&&(vf=new ee),vf),b)}
function ow(d,b,c){c=sw(c);return d.replace(RegExp(b,WB),c)}
function gu(b,c,d){b.d=d;A(b);b.b.s=c;Gm(b.b);b.f=c;fu(b)}
function en(b,c,d){bm(b,b.c=c>100?c:100,b.b=d>100?d:100)}
function Kv(b,c,d){var e;e=new Hv;e.c=b+c;e.b=d?8:0;return e}
function os(b,c,d){im(c);Vu(b.g,c);d.appendChild(c.z);jm(c,b)}
function qu(){nu();try{Is(mu,ku)}finally{lx(mu.b);lx(lu)}}
function pu(b){nu();try{hm(b)}finally{vx(mu.b,b)!=null}}
function Zq(b){!!Wq&&b==Wq&&(Wq=null);Qr();b===Sr&&(Sr=null)}
function Qg(b){return b!=null&&b.tM!=AA&&!(b.cM&&!!b.cM[1])}
function $m(b){return (b.z.scrollHeight||0)-b.z.clientHeight}
function ys(b){b.style[nB]=EA;b.style[oB]=EA;b.style[OA]=EA}
function Rl(b){b.b=(qo(),ho(EA));b.b.b.f=false;Ul(b.b);Tl(b.b)}
function Gy(b){if(b.c<=0){throw new _z}return b.b.zb(b.d=--b.c)}
function cv(b){if(b.b>=b.c.d){throw new _z}return b.c.b[++b.b]}
function Ew(){if(zw==256){yw=Aw;Aw={};zw=0}++zw}
function zy(b){if(b.d<0){throw new Uv}b.e.Cb(b.d);b.c=b.d;b.d=-1}
function iq(b){if(!b.o){return}b.o=false;if(b.c){b.c=false;hq(b)}}
function Fm(b){if(b.s){return}else b.v&&im(b);gu(b.r,true,false)}
function ac(b){if(_b(b)){return !!b&&b.nodeType==1}return false}
function _b(c){try{return !!c&&!!c.nodeType}catch(b){return false}}
function hb(){if(eb++==0){nb((mb(),lb));return true}return false}
function L(b){if(b.i==null){return Eg(Ek,{44:1},48,0,0)}return b.i}
function wr(b,c){return new fg(Uf((!rr&&(rr=new Mr),rr).b,b,c))}
function _r(b,c){return new fg(Uf(b.b.b,(!Cf&&(Cf=new ee),Cf),c))}
function Zu(b,c){var d;d=Wu(b,c);if(d==-1){throw new _z}Yu(b,d)}
function tx(b,c){var d;d=b.c;b.c=c;if(!b.d){b.d=true;++b.e}return d}
function Bg(b,c){var d,e;d=b;e=Cg(0,c);Fg(d.aC,d.cM,d.qI,e);return e}
function Fg(b,c,d,e){Jg();Lg(e,Hg,Ig);e.aC=b;e.cM=c;e.qI=d;return e}
function Lg(b,c,d){Jg();for(var e=0,f=c.length;e<f;++e){b[c[e]]=d[e]}}
function nA(b,c){this.b=b;this.e=c;this.d=Qk((new vz).b.getTime())}
function hA(){this.b=new Hz;this.c=new kA;rx(this.b,EA,this.c)}
function kA(){qo();this.b=new mo;this.b.d=EA;this.b.c=(_n(),Sn)}
function Rv(){zb(this);this.g='Widget must be a child of this panel.'}
function It(){It=AA;Gt=new Kt('bottom');new Kt('middle');Ht=new Kt(oB)}
function Ll(){var b;Rl(Jl);if(!G){b=(qo(),ho(Xh.c));G=new Ol(b)}}
function xx(b){var c;c=b.c;b.c=null;if(b.d){b.d=false;--b.e}return c}
function fr(b){b.f=false;b.g=null;b.b=false;b.c=false;b.d=true;b.e=null}
function A(b){if(!b.g){return}null.Db();b.i&&eu(b);b.i=false;b.g=false}
function Ju(b){if(!b.b||!b.d.u){throw new _z}b.b=false;return b.c=b.d.u}
function yy(b){if(b.c>=b.e.sb()){throw new _z}return b.e.zb(b.d=b.c++)}
function Ng(b,c){if(b!=null&&!(b.cM&&b.cM[c])){throw new Ov}return b}
function Kk(b){if(b!=null&&b.cM&&!!b.cM[2]){return b}return new T(b)}
function Yy(b,c,d){for(;d<b.c;++d){if(bA(c,b.b[d])){return d}}return -1}
function Bm(b,c){var d;d=c.target;if(ac(d)){return hc(b.z,d)}return false}
function cc(b){var c=b.parentNode;(!c||c.nodeType!=1)&&(c=null);return c}
function Ar(){var b;if(qr){b=new Fr;!!rr&&Kf(rr,b);return null}return null}
function Zy(b,c){var d;d=(ny(c,b.c),b.b[c]);b.b.splice(c,1);--b.c;return d}
function eA(b,c){if(Ng(nx(b.b,c.b.d),20)){return false}fA(b,c);return true}
function km(b,c){b.w==-1?_q(b.z,c|(b.z.__eventBits||0)):(b.w|=c)}
function gc(b){return typeof b.tabIndex!='undefined'?b.tabIndex:-1}
function Dt(b){return b==(vg(),tg)?(xt(),wt):b==ug?(xt(),tt):(xt(),ut)}
function Ft(b){return b==(vg(),tg)?(xt(),tt):b==ug?(xt(),wt):(xt(),vt)}
function gq(b){return new Yp(parseInt(b.p.z[zB])||0,parseInt(b.p.z[tB])||0)}
function pq(){this.d=new az;this.e=new Sq;this.i=new Sq;mq(this,new Pp)}
function ge(b,c){this.d=++ae;this.b=c;!Nd&&(Nd=new Ee);Nd.b[b]=this;this.c=b}
function ab(b,c){var d;return d=b,d.tM==AA||d.cM&&!!d.cM[1]?d.eQ(c):d===c}
function Og(b){if(b!=null&&(b.tM==AA||b.cM&&!!b.cM[1])){throw new Ov}return b}
function Wu(b,c){var d;for(d=0;d<b.d;++d){if(b.b[d]==c){return d}}return -1}
function $y(b,c){var d;d=Yy(b,c,0);if(d==-1){return false}Zy(b,d);return true}
function ux(f,b,c){var d,e=f.f;b=JA+b;b in e?(d=e[b]):++f.e;e[b]=c;return d}
function Kg(b,c,d){var e=0,f;for(var g in b){if(f=b[g]){c[e]=g;d[e]=f;++e}}}
function tw(b,c,d){b=b.slice(c,d);return String.fromCharCode.apply(null,b)}
function Qo(b,c,d,e){$wnd.navigator.notification.alert(b,function(){c.ab()},d,e)}
function Po(b){$doc.addEventListener('deviceready',function(){b._()},false)}
function rA(){jo(pA.b,(_n(),Xn),'Module loaded.',null);Ho();Fo=true;Jo()}
function bA(b,c){return (b==null?null:b)===(c==null?null:c)||b!=null&&ab(b,c)}
function Gz(b,c){return (b==null?null:b)===(c==null?null:c)||b!=null&&ab(b,c)}
function nc(b){return (mw(b.compatMode,SA)?b.documentElement:b.body).clientWidth}
function mc(b){return (mw(b.compatMode,SA)?b.documentElement:b.body).clientHeight}
function ng(b){if(null==b){throw new ew('encodedURLComponent cannot be null')}}
function bc(b){var c=b.firstChild;while(c&&c.nodeType!=1)c=c.nextSibling;return c}
function yx(e,b){var c,d=e.f;b=JA+b;if(b in d){c=d[b];--e.e;delete d[b]}return c}
function El(b){b=ow(b,'<','&lt;');b=ow(b,'>','&gt;');b=ow(b,jB,'<br>');return b}
function Jq(b){if(b.g){jv(b.g.b);b.g=null}if(b==b.f.g){b.f.g=null;lq(b.f,false)}}
function nb(b){var c,d;if(b.b){d=null;do{c=b.b;b.b=null;d=tb(c,d)}while(b.b);b.b=d}}
function ob(b){var c,d;if(b.c){d=null;do{c=b.c;b.c=null;d=tb(c,d)}while(b.c);b.c=d}}
function Hy(b,c){var d;this.b=b;this.e=b;d=b.sb();(c<0||c>d)&&ry(c,d);this.c=c}
function Xq(b,c,d){var e;e=Vq;Vq=b;c==Wq&&Pr(b.type)==8192&&(Wq=null);d.V(b);Vq=e}
function jo(b,c,d,e){var f;if(go(b).b.c<=c.b.c){f=new nA(c,d);f.f=e;f.c=b.d;ko(b,f)}}
function em(b,c,d){km(b,Pr(d.c));return new fg(Uf((!b.x?(b.x=new Lf(b)):b.x).b,d,c))}
function Ik(){switch(Hk){case 3:return new Vo;case 4:return new dp;}return new $o}
function mw(b,c){if(!(c!=null&&c.cM&&!!c.cM[1])){return false}return String(b)==c}
function nw(c,b){if(b==null)return false;return c==b||c.toLowerCase()==b.toLowerCase()}
function ib(c){return function(){try{return jb(c,this,arguments)}catch(b){throw b}}}
function pc(b){return (mw(b.compatMode,SA)?b.documentElement:b.body).scrollWidth||0}
function oc(b){return (mw(b.compatMode,SA)?b.documentElement:b.body).scrollHeight||0}
function bb(b){var c;return c=b,c.tM==AA||c.cM&&!!c.cM[1]?c.hC():c.$H||(c.$H=++fb)}
function mx(b,c){return c==null?b.d:c!=null&&c.cM&&!!c.cM[1]?qx(b,Ng(c,1)):px(b,c,~~bb(c))}
function Ob(b){var c;c=wb(Pb(b,Bb()),3);c.length==0&&(c=wb((new Cb).B(),1));return c}
function Ot(b){var c;c=$doc.createElement(NB);c[OB]=b.b.b;c.style[PB]=b.d.b;return c}
function Yq(b){var c;c=ir(ar,b);if(!c&&!!b){b.cancelBubble=true;b.preventDefault()}return c}
function gA(b,c){var d,e;d=Ng(nx(b.b,c),20);if(!d){e=new ro(c);fA(b,e);return e}return d}
function Eg(b,c,d,e,f){var g;g=Cg(f,e);Jg();Lg(g,Hg,Ig);g.aC=b;g.cM=c;g.qI=d;return g}
function Nt(b,c){var d;d=Ot(b);b.c.appendChild(d);im(c);Vu(b.g,c);d.appendChild(c.z);jm(c,b)}
function hq(b){var c;if(!b.f){return}c=eq(b.i,b.e);if(c){b.g=new Kq(b,c);ub((mb(),b.g),16)}}
function lq(b,c){if(c&&!b.b){b.b=br(new Eq(b))}else if(!c&&!!b.b){jv(b.b.b);b.b=null}}
function Qx(b){var c;this.d=b;c=new az;b.d&&Wy(c,new _x(b));kx(b,c);jx(b,c);this.b=new Ay(c)}
function jg(b){R.call(this,b.sb()==0?null:Ng(b.tb(Eg(Gk,{32:1,44:1},2,0,0)),32)[0]);this.b=b}
function Ru(){$s.call(this);this.b=(xt(),st);this.c=(It(),Ht);this.f[RB]=SB;this.f[TB]=SB}
function _n(){_n=AA;Mn();Sn=Dn;Tn=En;Un=Fn;Vn=Gn;Wn=Hn;Xn=In;Yn=Jn;Zn=Kn;$n=Ln}
function Bc(){Bc=AA;Ac=new Fc;xc=new Ic;yc=new Lc;zc=new Oc;wc=Fg(xk,{44:1},34,[Ac,xc,yc,zc])}
function nx(b,c){return c==null?b.c:c!=null&&c.cM&&!!c.cM[1]?b.f[JA+Ng(c,1)]:ox(b,c,~~bb(c))}
function vx(b,c){return c==null?xx(b):c!=null&&c.cM&&!!c.cM[1]?yx(b,Ng(c,1)):wx(b,c,~~bb(c))}
function rx(b,c,d){return c==null?tx(b,d):c!=null&&c.cM&&!!c.cM[1]?ux(b,Ng(c,1),d):sx(b,c,d,~~bb(c))}
function Vw(b,c){var d;while(b.kb()){d=b.lb();if(c==null?d==null:ab(c,d)){return b}}return null}
function eq(b,c){var d,e;e=c.c-b.c;if(e<=0){return null}d=Vp(b.b,c.b);return new Yp(d.b/e,d.c/e)}
function Pb(b,c){var d;d=Jb(b,c);return d.length==0?(new Cb).D(c):(d.length>=1&&d.splice(0,1),d)}
function hc(b,c){while(c){if(b==c){return true}c=c.parentNode;c&&c.nodeType!=1&&(c=null)}return false}
function ip(){var b,c;if(!hp){c=$doc.getElementsByTagName('head')[0];if(c){b=c;hp=b}}return hp}
function Br(){var b,c;if(ur){c=nc($doc);b=mc($doc);if(tr!=c||sr!=b){tr=c;sr=b;yf((!rr&&(rr=new Mr),rr))}}}
function ls(){var c=$wnd.onresize;$wnd.onresize=CA(function(b){try{Br()}finally{c&&c(b)}})}
function bm(b,c,d){c>=0&&(b.z.style[kB]=c+lB,undefined);d>=0&&(b.z.style[mB]=d+lB,undefined)}
function Ul(b){var c;c=Sl((Kr(),Ng(nx(Jr,'logLevel'),1)));c?(b.b.c=c,undefined):(b.b.c=(_n(),Xn),undefined)}
function Sm(b){this.c=b;em(b,this,(ke(),ke(),je));em(b,this,(ye(),ye(),xe));em(b,this,(re(),re(),qe))}
function ot(b){mt.call(this,$doc.createElement(ZA));this.z[pB]='gwt-HTML';bt(this.c,b,true);it(this)}
function Kq(b,c){this.f=b;this.b=new E;this.c=gq(this.f);this.e=new Sp(this.c,c);this.g=xr(new Nq(this))}
function br(b){Qr();!dr&&(dr=new ee);if(!ar){ar=new Mf(null,true);er=new gr}return new fg(Uf(ar.b,dr,b))}
function kx(f,b){var c=f.f;for(var d in c){if(d.charCodeAt(0)==58){var e=new fy(f,d.substring(1));b.ob(e)}}}
function So(b){var c;c=!b.cb()?'N/A':b.cb().db();return 'Device type ['+b.bb()+'], file URL ['+c+yB}
function Em(b,c,d){var e;b.n=c;b.t=d;c-=kc($doc);d-=lc($doc);e=b.z;e.style[nB]=c+(_c(),lB);e.style[oB]=d+lB}
function xs(b,c,d){var e;e=b.z;if(c==-1&&d==-1){ys(e)}else{e.style[OA]=RA;e.style[nB]=c+lB;e.style[oB]=d+lB}}
function Np(b,c,d,e){var f,g,i;i=b*c;if(d>=0){f=0>d-e?0:d-e;i=i<f?i:f}else{g=0<d+e?0:d+e;i=i>g?i:g}return i}
function Jb(b,c){var d,e,f;f=c&&c.stack?c.stack.split(KA):[];for(d=0,e=f.length;d<e;++d){f[d]=b.C(f[d])}return f}
function ho(b){var c,d,e;d=(!dA&&(dA=new hA),dA);c=Ng(nx(d.b,b),20);if(!c){e=new to(b);eA(d,e);return e}return c}
function $f(b){var c,d;if(b.b){try{for(d=new Ay(b.b);d.c<d.e.sb();){c=Ng(yy(d),31);c.nb()}}finally{b.b=null}}}
function Yu(b,c){var d;if(c<0||c>=b.d){throw new Yv}--b.d;for(d=c;d<b.d;++d){Gg(b.b,d,b.b[d+1])}Gg(b.b,b.d,null)}
function Px(b){if(!b.c){throw new Vv('Must call next() before remove().')}else{zy(b.b);vx(b.d,b.c.vb());b.c=null}}
function vm(b,c){if(b.u!=c){return false}try{jm(c,null)}finally{b.Y().removeChild(c.z);b.u=null}return true}
function wm(b,c){if(c==b.u){return}!!c&&im(c);!!b.u&&vm(b,b.u);b.u=c;if(c){b.Y().appendChild(b.u.z);jm(c,b)}}
function Gm(b){if(b.p){jv(b.p.b);b.p=null}if(b.j){jv(b.j.b);b.j=null}if(b.s){b.p=br(new Yt(b));b.j=or(new au(b))}}
function xt(){xt=AA;new Ct('center');new Ct('justify');tt=new Ct(nB);wt=new Ct('right');vt=tt;ut=wt;st=vt}
function vg(){vg=AA;ug=new wg('RTL',0);tg=new wg('LTR',1);sg=new wg('DEFAULT',2);rg=Fg(zk,{44:1},39,[ug,tg,sg])}
function Lk(b){var c,d,e;c=b&4194303;d=~~b>>22&4194303;e=b<0?1048575:0;return a=new al,a.l=c,a.m=d,a.h=e,a}
function Yf(b,c){var d,e;e=Ng(nx(b.e,c),29);if(!e){e=new Hz;rx(b.e,c,e)}d=Ng(e.c,30);if(!d){d=new az;tx(e,d)}return d}
function Zf(b,c){var d,e;e=Ng(nx(b.e,c),29);if(!e){return mz(),mz(),lz}d=Ng(e.c,30);if(!d){return mz(),mz(),lz}return d}
function ps(b,c){var d;if(c.y!=b){return false}try{jm(c,null)}finally{d=c.z;cc(d).removeChild(d);Zu(b.g,c)}return true}
function Dw(b){Bw();var c=JA+b;var d=Aw[c];if(d!=null){return d}d=yw[c];d==null&&(d=Cw(b));Ew();return Aw[c]=d}
function Fl(b){var c;c=new Nw;c.b.b+="<span style='color:";Mw(c,Dl(b.b.b.c));c.b.b+="'>";c.b.b+='<code>';return c.b.b}
function dc(b){var c;c=b.getBoundingClientRect&&b.getBoundingClientRect();return c?c.left+fc(b.ownerDocument.body):ic(b)}
function jp(b){var c,d,e;d=ip();c=(e=$doc.createElement('script'),e.type='text/javascript',e);c.text=b;d.appendChild(c)}
function lt(b){this.z=$doc.createElement(ZA);this.c=new ct(this.z);this.z[pB]='gwt-Label';bt(this.c,b,false);it(this)}
function ub(c,d){mb();$wnd.setTimeout(function(){var b=CA(qb)(c);b&&$wnd.setTimeout(arguments.callee,d)},d)}
function gwtOnLoad(c,d,e,f){$moduleName=d;$moduleBase=e;Hk=f;if(c)try{CA(Jk)()}catch(b){c(d)}else{CA(Jk)()}}
function zb(b){var c,d,e,f;e=Ob(new Qb);f=Eg(Ek,{44:1},48,e.length,0);for(c=0,d=f.length;c<d;++c){f[c]=new jw(e[c])}M(b,f)}
function M(b,c){var d,e,f;e=Eg(Ek,{44:1},48,c.length,0);for(f=0,d=c.length;f<d;++f){if(!c[f]){throw new dw}e[f]=c[f]}b.i=e}
function Xf(b,c,d){var e,f,g;e=Zf(b,c);f=e.rb(d);f&&e.qb()&&(g=Ng(nx(b.e,c),29),Ng(xx(g),30),g.e==0&&vx(b.e,c),undefined)}
function Od(b,c,d){var e,f,g;if(Nd){g=Ng(Nd.b[b.type],5);if(g){e=g.b.b;f=g.b.c;g.b.b=b;g.b.c=d;fm(c,g.b);g.b.b=e;g.b.c=f}}}
function Al(b,c){var d,e;d=new wz(b.d);e=new Nw;Mw(e,uz(d));e.b.b+=dB;Mw(e,b.c);e.b.b+=c;Mw(e,b.b.b.b);e.b.b+=DA;return e.b.b}
function ru(){nu();var b;b=Ng(nx(lu,null),27);if(b){return b}lu.e==0&&vr(new yu);b=new Bu;rx(lu,null,b);Kz(mu,b);return b}
function eu(b){if(!b.f){du(b);b.d||vs((nu(),ru()),b.b)}b.b.z.style['clip']='rect(auto, auto, auto, auto)';b.b.z.style[uB]=VB}
function Ye(){var b;this.b=(b=document.createElement(ZA),b.setAttribute('ontouchstart','return;'),typeof b.ontouchstart==HA)}
function R(b){zb(this);this.f=b;this.g='One or more exceptions caught, see full set in UmbrellaException#getCauses'}
function Io(){if($wnd.PhoneGap==null){return}$wnd.PhoneGap.onDOMContentLoaded.fire();$wnd.PhoneGap.onNativeReady.fire()}
function bt(b,c,d){d?(b.b.innerHTML=c||EA,undefined):(b.b.textContent=c||EA,undefined);if(b.d!=b.c){b.d=b.c;pg(b.b,b.c)}}
function ko(b,c){var d,e;if(io(b,c.b)){for(e=new Ay(b.b);e.c<e.e.sb();){d=Ng(yy(e),21);d.Q(c)}b.f&&!!b.e&&(ko(b.e.b,c),undefined)}}
function Iq(b){var c,d;if(b!=b.f.g){Jq(b);return false}c=D(b.b);b.e.c=c-b.d;b.d=c;b.e.b=c;d=Op(b.e);d||Jq(b);oq(b.f,b.e.e);return d}
function fA(b,c){var d,e,f;d=c.b.d;f=d.substr(0,bw(d.lastIndexOf(String.fromCharCode(46)))-0);e=gA(b,f);rx(b.b,c.b.d,c);lo(c.b,e)}
function Ao(){Ao=AA;zo=new Bo('UNSUPPORTED',0);xo=new Bo('ANDROID',1);yo=new Bo('IOS',2);wo=Fg(Bk,{44:1},41,[zo,xo,yo])}
function $k(){$k=AA;Xk=(a=new al,a.l=4194303,a.m=4194303,a.h=524287,a);Yk=(a=new al,a.l=0,a.m=0,a.h=524288,a);Rk(1);Rk(2);Zk=Rk(0)}
function Y(b){var c;return b==null?'null':Qg(b)?Z(Og(b)):b!=null&&b.cM&&!!b.cM[1]?FA:(c=b,c.tM==AA||c.cM&&!!c.cM[1]?c.gC():Vg).c}
function og(b){var c;c=b[aB]==null?null:String(b[aB]);if(nw(NA,c)){return vg(),ug}else if(nw(bB,c)){return vg(),tg}return vg(),sg}
function px(j,b,c){var d=j.b[c];if(d){for(var e=0,f=d.length;e<f;++e){var g=d[e];var i=g.vb();if(j.ub(b,i)){return true}}}return false}
function ox(j,b,c){var d=j.b[c];if(d){for(var e=0,f=d.length;e<f;++e){var g=d[e];var i=g.vb();if(j.ub(b,i)){return g.wb()}}}return null}
function Gx(b,c){var d,e,f;if(c!=null&&c.cM&&!!c.cM[49]){d=Ng(c,49);e=d.vb();if(mx(b.b,e)){f=nx(b.b,e);return Gz(d.wb(),f)}}return false}
function vb(b){var c,d,e;e=EA;b=rw(b);c=b.indexOf(GA);if(c!=-1){d=b.indexOf(HA)==0?8:0;e=rw(b.substr(d,c-d))}return e.length>0?e:IA}
function Rk(b){var c,d;if(b>-129&&b<128){c=b+128;Ok==null&&(Ok=Eg(Ak,{44:1},40,256,0));d=Ok[c];!d&&(d=Ok[c]=Lk(b));return d}return Lk(b)}
function yb(b,c){var d,e,f,g;f=Pb(b,Qg(c.c)?Og(c.c):null);g=Eg(Ek,{44:1},48,f.length,0);for(d=0,e=g.length;d<e;++d){g[d]=new jw(f[d])}M(c,g)}
function jx(j,b){var c=j.b;for(var d in c){var e=parseInt(d,10);if(d==e){var f=c[e];for(var g=0,i=f.length;g<i;++g){b.ob(f[g])}}}}
function pg(b,c){switch(c.c){case 0:{b[aB]=NA;break}case 1:{b[aB]=bB;break}case 2:{og(b)!=(vg(),sg)&&(b[aB]=EA,undefined);break}}}
function ec(b){var c;c=b.getBoundingClientRect&&b.getBoundingClientRect();return c?c.top+(b.ownerDocument.body.scrollTop||0):jc(b)}
function rw(d){if(d.length==0||d[0]>dB&&d[d.length-1]>dB){return d}var b=d.replace(/^(\s*)/,EA);var c=b.replace(/\s*$/,EA);return c}
function oq(b,c){b.p.z[zB]=~~Math.max(Math.min(c.b,2147483647),-2147483648);b.p.z[tB]=~~Math.max(Math.min(c.c,2147483647),-2147483648)}
function Gg(b,c,d){if(d!=null){if(b.qI>0&&!Mg(d,b.qI)){throw new vv}if(b.qI<0&&(d.tM==AA||d.cM&&!!d.cM[1])){throw new vv}}return b[c]=d}
function it(b){var c;!b.b?(c=null):b.b?(c=b.b):(c=b.b==(rt(),qt)?Ft(b.c.d):Dt(b.c.d));if(c!=b.d){b.d=c;b.z.style['textAlign']=!b.d?EA:b.d.b}}
function Ab(c){var d=EA;try{for(var e in c){if(e!='name'&&e!='message'&&e!='toString'){try{d+='\n '+e+DA+c[e]}catch(b){}}}}catch(b){}return d}
function Xs(b){var c;this.z=(c=$doc.createElement('BUTTON'),c.setAttribute('type','button'),c);this.z[pB]='gwt-Button';this.z.innerHTML=b||EA}
function $s(){this.g=new $u(this);this.f=$doc.createElement('table');this.e=$doc.createElement('tbody');this.f.appendChild(this.e);this.z=this.f}
function Pt(){$s.call(this);this.b=(xt(),st);this.d=(It(),Ht);this.c=$doc.createElement(QB);this.e.appendChild(this.c);this.f[RB]=SB;this.f[TB]=SB}
function fu(b){du(b);if(b.f){b.b.z.style[OA]=RA;b.b.t!=-1&&Em(b.b,b.b.n,b.b.t);ts((nu(),ru()),b.b)}else{b.d||vs((nu(),ru()),b.b)}b.b.z.style[uB]=VB}
function im(b){if(!b.y){(nu(),mx(mu.b,b))&&pu(b)}else if(b.y){b.y.X(b)}else if(b.y){throw new Vv("This widget's parent does not implement HasWidgets")}}
function sw(b){var c;c=0;while(0<=(c=b.indexOf('\\',c))){b.charCodeAt(c+1)==36?(b=b.substr(0,c-0)+'$'+qw(b,++c)):(b=b.substr(0,c-0)+qw(b,++c))}return b}
function Tt(){var b;b=null.Db();nc($doc);mc($doc);b[UB]=(Bc(),sB);null.Db(_c());null.Db(_c());pc($doc);oc($doc);null.Db(_c());null.Db(_c());b[UB]='block'}
function _y(b,c){var d,e,f;c.length<b.c&&(c=(e=c,f=Cg(0,b.c),Fg(e.aC,e.cM,e.qI,f),f));for(d=0;d<b.c;++d){Gg(c,d,b.b[d])}c.length>b.c&&Gg(c,b.c,null);return c}
function _c(){_c=AA;$c=new dd;Yc=new gd;Tc=new jd;Uc=new md;Zc=new pd;Xc=new sd;Vc=new vd;Sc=new yd;Wc=new Bd;Rc=Fg(yk,{44:1},36,[$c,Yc,Tc,Uc,Zc,Xc,Vc,Sc,Wc])}
function Ko(){var b;Fo&&(jo(Go.b,(_n(),Xn),So(Eo),null),undefined);if(Eo.bb()==(Ao(),zo)){return false}b=Eo.cb();if(!b){return false}jp(Eo.cb().eb());return true}
function du(b){if(b.f){if(b.b.k){$doc.body.appendChild(b.b.g);b.e=xr(b.b.i);Tt();b.c=true}}else if(b.c){$doc.body.removeChild(b.b.g);jv(b.e.b);b.e=null;b.c=false}}
function fc(b){if(b.ownerDocument.defaultView.getComputedStyle(b,EA).direction==NA){return (b.scrollLeft||0)-((b.scrollWidth||0)-b.clientWidth)}return b.scrollLeft||0}
--></script>
<script><!--
function hw(){hw=AA;gw=Fg(wk,{44:1},-1,[48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122])}
function Ww(b){var c,d,e,f;e=new Hw;c=null;e.b.b+=MA;d=b.Z();while(d.kb()){c!=null?(e.b.b+=c,e):(c=XB);f=d.lb();e.b.b+=f===b?'(this Collection)':EA+f}e.b.b+=yB;return e.b.b}
function _v(b){var c,d,e;c=Eg(wk,{44:1},-1,8,1);d=(hw(),gw);e=7;if(b>=0){while(b>15){c[e--]=d[b&15];b>>=4}}else{while(e>0){c[e--]=d[b&15];b>>=4}}c[e]=d[b&15];return tw(c,e,8)}
function tb(c,d){var b,e,f,g,i;for(f=0,g=c.length;f<g;++f){i=c[f];try{i[1]?Iq(i[0])&&(d=sb(d,i)):i[0].Db()}catch(b){b=Kk(b);if(Pg(b,3)){e=b;!!G&&Nl(G,e)}else throw b}}return d}
function ir(b,c){var d,e,f,g,i;if(!!dr&&!!b&&mx(b.b.e,dr)){d=er.b;e=er.c;f=er.d;g=er.e;fr(er);er.e=c;Kf(b,er);i=!(er.b&&!er.c);er.b=d;er.c=e;er.d=f;er.e=g;return i}return true}
function Ez(){Ez=AA;Cz=Fg(Fk,{44:1},1,['Sun','Mon','Tue','Wed','Thu','Fri','Sat']);Dz=Fg(Fk,{44:1},1,['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'])}
function Kf(c,d){var b,e,f;!d.f||d.H();f=d.g;d.g=c.c;try{Wf(c.b,d)}catch(b){b=Kk(b);if(Pg(b,18)){e=b;throw new lg(e.b)}else throw b}finally{f==null?(d.f=true,d.g=null):(d.g=f)}}
function Cg(b,c){var d=new Array(c);if(b==3){for(var e=0;e<c;++e){var f=new Object;f.l=f.m=f.h=0;d[e]=f}}else if(b>0){var f=[null,0,false][b];for(var e=0;e<c;++e){d[e]=f}}return d}
function jm(b,c){var d;d=b.y;if(!c){try{!!d&&d.v&&hm(b)}finally{b.y=null}}else{if(d){throw new Vv('Cannot set a new parent without first clearing the old parent')}b.y=c;c.v&&b.U()}}
function wx(j,b,c){var d=j.b[c];if(d){for(var e=0,f=d.length;e<f;++e){var g=d[e];var i=g.vb();if(j.ub(b,i)){d.length==1?delete j.b[c]:d.splice(e,1);--j.e;return g.wb()}}}return null}
function sx(n,b,c,d){var e=n.b[d];if(e){for(var f=0,g=e.length;f<g;++f){var i=e[f];var j=i.vb();if(n.ub(b,j)){var k=i.wb();i.xb(c);return k}}}else{e=n.b[d]=[]}var i=new Vz(b,c);e.push(i);++n.e;return null}
function Tl(b){var c,d,e,f,g,i;c=new hl;Wy(b.b.b,c);d=new ll;Wy(b.b.b,d);e=new pl;Wy(b.b.b,e);i=new vn;Wy(b.b.b,i);g=new rn;!!g||(Wy(b.b.b,null),undefined);f=new Lm;Wy(b.b.b,new tl(f))}
function cl(b){return $stats({moduleName:$moduleName,sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date).getTime(),type:'onModuleLoadStart',className:b})}
function hm(b){if(!b.v){throw new Vv("Should only call onDetach when the widget is attached to the browser's document")}try{b.W()}finally{try{b.T()}finally{b.z.__listener=null;b.v=false}}}
function gm(b){var c;if(b.v){throw new Vv("Should only call onAttach when the widget is detached from the browser's document")}b.v=true;b.z.__listener=b;c=b.w;b.w=-1;c>0&&(b.w==-1?_q(b.z,c|(b.z.__eventBits||0)):(b.w|=c));b.S()}
function Sk(b,c){var d,e;d=~~b.h>>19;e=~~c.h>>19;return d==0?e!=0||b.h>c.h||b.h==c.h&&b.m>c.m||b.h==c.h&&b.m==c.m&&b.l>=c.l:!(e==0||b.h<c.h||b.h==c.h&&b.m<c.m||b.h==c.h&&b.m==c.m&&b.l<c.l)}
function Qu(b,c){var d,e,f;e=$doc.createElement(QB);d=(f=$doc.createElement(NB),f[OB]=b.b.b,f.style[PB]=b.c.b,f);e.appendChild(d);b.e.appendChild(e);im(c);Vu(b.g,c);d.appendChild(c.z);jm(c,b)}
function jb(c,d,e){var b,f,g;f=hb();try{if(G){try{return gb(c,d,e)}catch(b){b=Kk(b);if(Pg(b,2)){g=b;Nl(G,g);return undefined}else throw b}}else{return gb(c,d,e)}}finally{f&&ob((mb(),lb));--eb}}
function Jo(){Ho();jo(Go.b,(_n(),Xn),'User agent: '+$wnd.navigator.userAgent,null);if(Ko()){jo(Go.b,Xn,'Native API loaded.',null);Po(new Mo);Io()}else{jo(Go.b,Xn,'Native API unavailable.',null)}}
function Is(c,d){var j;Fs();var b,e,f,g,i;e=null;for(i=c.Z();i.kb();){g=Ng(i.lb(),26);try{d.jb(g)}catch(b){b=Kk(b);if(Pg(b,2)){f=b;!e&&(e=new Lz);j=rx(e.b,f,e)}else throw b}}if(e){throw new Gs(e)}}
function Cw(b){var c,d,e,f;c=0;e=b.length;f=e-4;d=0;while(d<f){c=b.charCodeAt(d+3)+31*(b.charCodeAt(d+2)+31*(b.charCodeAt(d+1)+31*(b.charCodeAt(d)+31*c)))|0;d+=4}while(d<e){c=c*31+b.charCodeAt(d++)}return c|0}
function Uf(b,c,d){var e;if(!c){throw new ew('Cannot add a handler with a null type')}if(!d){throw new ew('Cannot add a null handler')}b.c>0?Tf(b,new nv(b,c,d)):(e=Yf(b,c),e.ob(d),undefined);return new kv(b,c,d)}
function Xu(b,c,d){var e,f;if(d<0||d>b.d){throw new Yv}if(b.d==b.b.length){f=Eg(Ck,{44:1},26,b.b.length*2,0);for(e=0;e<b.b.length;++e){Gg(f,e,b.b[e])}b.b=f}++b.d;for(e=b.d-1;e>d;--e){Gg(b.b,e,b.b[e-1])}Gg(b.b,d,c)}
function Uk(b){var c,d,e;if(Pk(b,($k(),Yk))){return -9223372036854775808}if(!Sk(b,Zk)){return -Nk((c=~b.l+1&4194303,d=~b.m+(c==0?1:0)&4194303,e=~b.h+(c==0&&d==0?1:0)&1048575,Mk(c,d,e)))}return b.l+b.m*4194304+b.h*17592186044416}
function an(b){var c,d;if(b.e){return false}b.e=(c=(!dq&&(dq=(Av(),(!Ie&&(Ie=new Ye),Ie.b)&&!(d=navigator.userAgent.toLowerCase(),/android ([3-9]+)\.([0-9]+)/.exec(d)!=null)?zv:yv)),dq.b?new pq:null),!!c&&nq(c,b),c);return !b.e}
function Tk(b,c){var d,e,f,g;c&=63;d=b.h&1048575;if(c<22){g=~~d>>>c;f=~~b.m>>c|d<<22-c;e=~~b.l>>c|b.m<<22-c}else if(c<44){g=0;f=~~d>>>c-22;e=~~b.m>>c-22|b.h<<44-c}else{g=0;f=0;e=~~d>>>c-44}return Mk(e&4194303,f&4194303,g&1048575)}
function fn(){this.z=$doc.createElement(ZA);!Zm&&(Zm=new Gu);this.z.style[uB]='auto';this.d=$doc.createElement(ZA);this.z.appendChild(this.d);this.z.style[OA]=vB;this.d.style[OA]=vB;this.z.style[wB]=qB;this.d.style[wB]=qB;an(this)}
function Mn(){Mn=AA;Dn=new co('ALL',-2147483648);En=new co('CONFIG',700);Fn=new co('FINE',500);Gn=new co('FINER',400);Hn=new co('FINEST',300);In=new co('INFO',800);Jn=new co('OFF',2147483647);Kn=new co('SEVERE',1000);Ln=new co('WARNING',900)}
function Dl(b){if(b==(_n(),Yn).b.c){return hB}if(b>=Zn.b.c){return '#F00'}if(b>=$n.b.c){return '#E56717'}if(b>=Xn.b.c){return '#20b000'}if(b>=Tn.b.c){return '#2B60DE'}if(b>=Un.b.c){return iB}if(b>=Vn.b.c){return iB}if(b>=Wn.b.c){return iB}return hB}
function kq(b,c){var d,e,f;if(b.o){return}lq(b,!!b.g);fq(b);b.o=true;e=(f=c.b.touches,f.length>0?f[0]:null);b.n=new Yp(e.pageX,e.pageY);d=(new Date).getTime();Rq(b.i,b.n,d);Rq(b.e,b.n,d);b.j=null;b.k=new Yp(parseInt(b.p.z[zB])||0,parseInt(b.p.z[tB])||0)}
function gs(j){var d=EA;var e=$wnd.location.hash;e.length>0&&(d=j.gb(e.substring(1)));$r=d;var f=j;var g=CA(function(){var b=EA,c=$wnd.location.hash;c.length>0&&(b=f.gb(c.substring(1)));f.hb(b)});var i=function(){$wnd.setTimeout(i,250);g()};i();return true}
function Op(b){var c,d,e,f,g,i,j,k,n,o,p,q;f=b.c;q=b.b;g=b.d;o=b.f;c=Math.pow(0.9993,q);i=f*5.0E-4;k=Np(g.b,c,o.b,i);n=Np(g.c,c,o.c,i);j=new Yp(k,n);b.f=j;e=b.c;d=Wp(j,new Yp(e,e));p=b.e;b.e=new Yp(p.b+d.b,p.c+d.c);if(aw(j.b)<0.02&&aw(j.c)<0.02){return false}return true}
function Kr(){var b,c,d,e,f,g,i,j;if(!Jr){Jr=new Hz;i=$wnd.location.search;if(i!=null&&i.length>1){g=i.substr(1,i.length-1);for(d=pw(g,'&',0),e=0,f=d.length;e<f;++e){c=d[e];b=pw(c,CB,2);b.length>1?rx(Jr,b[0],(ng(b[1]),j=/\+/g,decodeURIComponent(b[1].replace(j,'%20')))):rx(Jr,b[0],EA)}}}}
function nq(b,c){var d,e;if(b.p==c){return}fq(b);lq(b,false);if(b.p){for(e=new Ay(b.d);e.c<e.e.sb();){d=Ng(yy(e),23);jv(d.b)}Xy(b.d)}b.p=c;if(c){Wy(b.d,em(c,new sq(b),(hf(),hf(),gf)));Wy(b.d,em(c,new vq(b),(af(),af(),_e)));Wy(b.d,em(c,new yq(b),(Se(),Se(),Re)));Wy(b.d,em(c,new Bq(b),(Le(),Le(),Ke)))}}
function uz(b){var c,d,e;e=-b.b.getTimezoneOffset();c=(e>=0?'+':EA)+~~(e/60);d=(e<0?-e:e)%60<10?SB+(e<0?-e:e)%60:EA+(e<0?-e:e)%60;return (Ez(),Cz)[b.b.getDay()]+dB+Dz[b.b.getMonth()]+dB+Az(b.b.getDate())+dB+Az(b.b.getHours())+JA+Az(b.b.getMinutes())+JA+Az(b.b.getSeconds())+' GMT'+c+d+dB+b.b.getFullYear()}
function Bl(b,c,d){var e,f,g,i,j,k,n;if(!b){return EA}i=new Iw(c);f=b;e=EA;j=new Lz;while(!!f&&!mx(j.b,f)){n=rx(j.b,f,j);i.b.b+=e;e=c+'Caused by: ';Gw(i,f.gC().c);Gw(i,DA+f.A());k=L(f);if(k!=null){for(g=0;g<k.length;++g){i.b.b+=c+d+LA;Gw(i,k[g].b+eB+k[g].d+fB+(k[g].c>=0?JA+k[g].c:EA)+gB)}}f=f.f}return i.b.b}
function Wf(c,d){var b,e,f,g,i,j,k;if(!d){throw new ew('Cannot fire null event')}try{++c.c;i=Zf(c,d.G());e=null;j=c.d?i.Bb(i.sb()):i.Ab();while(c.d?j.c>0:j.c<j.e.sb()){g=c.d?Gy(j):yy(j);try{d.F(Ng(g,28))}catch(b){b=Kk(b);if(Pg(b,2)){f=b;!e&&(e=new Lz);k=rx(e.b,f,e)}else throw b}}if(e){throw new jg(e)}}finally{--c.c;c.c==0&&$f(c)}}
function Sl(b){if(b==null){return null}if(mw(b,(_n(),Yn).b.b)){return Yn}else if(mw(b,Zn.b.b)){return Zn}else if(mw(b,$n.b.b)){return $n}else if(mw(b,Xn.b.b)){return Xn}else if(mw(b,Tn.b.b)){return Tn}else if(mw(b,Un.b.b)){return Un}else if(mw(b,Vn.b.b)){return Vn}else if(mw(b,Wn.b.b)){return Wn}else if(mw(b,Sn.b.b)){return Sn}return null}
function ks(){var e=$wnd.onbeforeunload;var f=$wnd.onunload;$wnd.onbeforeunload=function(b){var c,d;try{c=CA(Ar)()}finally{d=e&&e(b)}if(c!=null){return c}if(d!=null){return d}};$wnd.onunload=CA(function(b){try{qr&&rf((!rr&&(rr=new Mr),rr))}finally{f&&f(b);$wnd.onresize=null;$wnd.onscroll=null;$wnd.onbeforeunload=null;$wnd.onunload=null}})}
function Jk(){var b;!!$stats&&cl('com.google.gwt.user.client.UserAgentAsserter');b=pr();mw(cB,b)||($wnd.alert('ERROR: Possible problem with your *.gwt.xml module file.\nThe compile time user.agent value (safari) does not match the runtime user.agent value ('+b+'). Expect more errors.\n'),undefined);!!$stats&&cl('com.google.gwt.logging.client.LogConfiguration');Ll(Kl());!!$stats&&cl('nl.isaac.labs.mobile.client.Sandbox');rA(qA())}
function Dm(b,c){var d,e,f,g;if(c.b||!b.q&&c.c){b.o&&(c.b=true);return}c.d&&(c.e,false)&&(c.b=true);if(c.b){return}e=c.e;d=Bm(b,e);d&&(c.c=true);b.o&&(c.b=true);g=Pr(e.type);switch(g){case 512:case 256:case 128:{return}case 4:if(Wq){c.c=true;return}if(!d&&b.e){Cm(b);return}break;case 8:case 64:case 1:case 2:{if(Wq){c.c=true;return}break}case 2048:{f=e.target;if(b.o&&!d&&!!f){f.blur&&f!=$doc.body&&f.blur();c.b=true;return}break}}}
function jc(b){if(b.offsetTop==null){return 0}var c=0;var d=b.ownerDocument;var e=b.parentNode;if(e){while(e.offsetParent){c-=e.scrollTop;e=e.parentNode}}while(b){c+=b.offsetTop;if(d.defaultView.getComputedStyle(b,EA)[OA]==PA){c+=d.body.scrollTop;return c}var f=b.offsetParent;f&&$wnd.devicePixelRatio&&(c+=parseInt(d.defaultView.getComputedStyle(f,EA).getPropertyValue('border-top-width')));if(f&&f.tagName==QA&&b.style.position==RA){break}b=f}return c}
function pw(p,b,c){var d=new RegExp(b,WB);var e=[];var f=0;var g=p;var i=null;while(true){var j=d.exec(g);if(j==null||g==EA||f==c-1&&c>0){e[f]=g;break}else{e[f]=g.substring(0,j.index);g=g.substring(j.index+j[0].length,g.length);d.lastIndex=0;if(i==g){e[f]=g.substring(0,1);g=g.substring(1)}i=g;f++}}if(c==0&&p.length>0){var k=e.length;while(k>0&&e[k-1]==EA){--k}k<e.length&&e.splice(k,e.length-k)}var n=Eg(Fk,{44:1},1,e.length,0);for(var o=0;o<e.length;++o){n[o]=e[o]}return n}
function ic(b){if(b.offsetLeft==null){return 0}var c=0;var d=b.ownerDocument;var e=b.parentNode;if(e){while(e.offsetParent){c-=e.scrollLeft;d.defaultView.getComputedStyle(e,EA).getPropertyValue('direction')==NA&&(c+=e.scrollWidth-e.clientWidth);e=e.parentNode}}while(b){c+=b.offsetLeft;if(d.defaultView.getComputedStyle(b,EA)[OA]==PA){c+=d.body.scrollLeft;return c}var f=b.offsetParent;f&&$wnd.devicePixelRatio&&(c+=parseInt(d.defaultView.getComputedStyle(f,EA).getPropertyValue('border-left-width')));if(f&&f.tagName==QA&&b.style.position==RA){break}b=f}return c}
function pr(){var c=navigator.userAgent.toLowerCase();var d=function(b){return parseInt(b[1])*1000+parseInt(b[2])};if(function(){return c.indexOf(AB)!=-1}())return AB;if(function(){return c.indexOf('webkit')!=-1}())return cB;if(function(){return c.indexOf(BB)!=-1&&$doc.documentMode>=9}())return 'ie9';if(function(){return c.indexOf(BB)!=-1&&$doc.documentMode>=8}())return 'ie8';if(function(){var b=/msie ([0-9]+)\.([0-9]+)/.exec(c);if(b&&b.length==3)return d(b)>=6000}())return 'ie6';if(function(){return c.indexOf('gecko')!=-1}())return 'gecko1_8';return 'unknown'}
function Qk(b){var c,d,e,f,g,i,j,k;if(isNaN(b)){return $k(),Zk}if(b<-9223372036854775808){return $k(),Yk}if(b>=9223372036854775807){return $k(),Xk}f=false;if(b<0){f=true;b=-b}e=0;if(b>=17592186044416){e=~~Math.max(Math.min(b/17592186044416,2147483647),-2147483648);b-=e*17592186044416}d=0;if(b>=4194304){d=~~Math.max(Math.min(b/4194304,2147483647),-2147483648);b-=d*4194304}c=~~Math.max(Math.min(b,2147483647),-2147483648);g=(a=new al,a.l=c,a.m=d,a.h=e,a);f&&(i=~g.l+1&4194303,j=~g.m+(i==0?1:0)&4194303,k=~g.h+(i==0&&j==0?1:0)&1048575,g.l=i,g.m=j,g.h=k,undefined);return g}
function jq(b,c){var d,e,f,g,i,j,k,n,o,p,q,r,s,t;if(!b.o){return}j=(r=c.b.touches,r.length>0?r[0]:null);k=new Yp(j.pageX,j.pageY);n=(new Date).getTime();Rq(b.e,k,n);if(!b.c){f=Vp(k,b.n);d=aw(f.b);e=aw(f.c);if(d>5||e>5){if(d>e){i=parseInt(b.p.z[zB])||0;g=Fu(b.p.z);if(f.b<0&&g<=i){fq(b);return}else if(f.b>0&&0>=i){fq(b);return}}else{q=parseInt(b.p.z[tB])||0;p=$m(b.p);if(f.c<0&&p<=q){fq(b);return}else if(f.c>0&&0>=q){fq(b);return}}b.c=true}}c.b.preventDefault();if(b.c){t=Vp(b.n,b.e.b);s=Xp(b.k,t);b.p.z[zB]=~~Math.max(Math.min(s.b,2147483647),-2147483648);b.p.z[tB]=~~Math.max(Math.min(s.c,2147483647),-2147483648);o=n-b.i.c;if(o>200&&!!b.j){Rq(b.i,b.j.b,b.j.c);b.j=null}else o>100&&!b.j&&(b.j=new Tq(k,n))}}
function Pr(b){switch(b){case 'blur':return 4096;case 'change':return 1024;case TA:return 1;case DB:return 2;case 'focus':return 2048;case EB:return 128;case FB:return 256;case GB:return 512;case 'load':return 32768;case 'losecapture':return 8192;case UA:return 4;case VA:return 64;case HB:return 32;case IB:return 16;case WA:return 8;case 'scroll':return 16384;case 'error':return 65536;case 'DOMMouseScroll':case JB:return 131072;case 'contextmenu':return 262144;case 'paste':return 524288;case _A:return 1048576;case $A:return 2097152;case YA:return 4194304;case XA:return 8388608;case KB:return 16777216;case LB:return 33554432;case MB:return 67108864;case 'ended':return 134217728;case 'progress':return 268435456;case 'canplaythrough':return 536870912;default:return -1;}}
function Lm(){var b,c,d,e,f,g;this.z=$doc.createElement(ZA);this.i=new Ut;this.r=new hu(this);this.z.appendChild($doc.createElement(ZA));Em(this,0,0);(f=bc(this.z).parentNode,(!f||f.nodeType!=1)&&(f=null),f)[pB]='gwt-PopupPanel';bc(this.z)[pB]='popupContent';this.e=false;this.f=false;this.o=false;c=new Ru;c.f['border']=qB;c.z.style['backgroundColor']='white';e=new ot('<center><b>Logging<\/b><\/center>');Qu(c,e);new jn(this,e);this.d=new fn;Qu(c,this.d);this.b=new Ru;wm(this.d,this.b);en(this.d,300,200);b=new Pt;Qu(c,b);b.z.style[kB]='100%';b.d=(It(),Gt);d=new Xs(rB);g=Ot(b);b.c.appendChild(g);im(d);Vu(b.g,d);g.appendChild(d.z);jm(d,b);em(d,new Om(this,d),(Ud(),Ud(),Td));this.c=new ot("<div style='font-size:200%; line-height:75%'>\u21F2<\/div>");ht(this.c,(xt(),wt));Nt(b,this.c);new nn(this,this.c);wm(this,c);Fm(this)}
function Xr(){Tr=CA(function(b){if(!Yq(b)){b.stopPropagation();b.preventDefault();return false}return true});Vr=CA(function(b){var c,d=this;while(d&&!(c=d.__listener)){d=d.parentNode}d&&d.nodeType!=1&&(d=null);c&&Rr(c)&&Xq(b,d,c)});Wr=CA(function(b){this.__gwtLastUnhandledEvent=b.type;Vr.call(this,b)});Ur=CA(function(b){var c=Tr;if(c(b)){var d=Sr;if(d&&d.__listener){if(Rr(d.__listener)){Xq(b,d,d.__listener);b.stopPropagation()}}}});$wnd.addEventListener(TA,Ur,true);$wnd.addEventListener(DB,Ur,true);$wnd.addEventListener(UA,Ur,true);$wnd.addEventListener(WA,Ur,true);$wnd.addEventListener(VA,Ur,true);$wnd.addEventListener(IB,Ur,true);$wnd.addEventListener(HB,Ur,true);$wnd.addEventListener(JB,Ur,true);$wnd.addEventListener(EB,Tr,true);$wnd.addEventListener(GB,Tr,true);$wnd.addEventListener(FB,Tr,true);$wnd.addEventListener(_A,Ur,true);$wnd.addEventListener($A,Ur,true);$wnd.addEventListener(YA,Ur,true);$wnd.addEventListener(XA,Ur,true);$wnd.addEventListener(KB,Ur,true);$wnd.addEventListener(LB,Ur,true);$wnd.addEventListener(MB,Ur,true)}
function Yr(b,c){var d=(b.__eventBits||0)^c;b.__eventBits=c;if(!d)return;d&1&&(b.onclick=c&1?Vr:null);d&2&&(b.ondblclick=c&2?Vr:null);d&4&&(b.onmousedown=c&4?Vr:null);d&8&&(b.onmouseup=c&8?Vr:null);d&16&&(b.onmouseover=c&16?Vr:null);d&32&&(b.onmouseout=c&32?Vr:null);d&64&&(b.onmousemove=c&64?Vr:null);d&128&&(b.onkeydown=c&128?Vr:null);d&256&&(b.onkeypress=c&256?Vr:null);d&512&&(b.onkeyup=c&512?Vr:null);d&1024&&(b.onchange=c&1024?Vr:null);d&2048&&(b.onfocus=c&2048?Vr:null);d&4096&&(b.onblur=c&4096?Vr:null);d&8192&&(b.onlosecapture=c&8192?Vr:null);d&16384&&(b.onscroll=c&16384?Vr:null);d&32768&&(b.onload=c&32768?Wr:null);d&65536&&(b.onerror=c&65536?Vr:null);d&131072&&(b.onmousewheel=c&131072?Vr:null);d&262144&&(b.oncontextmenu=c&262144?Vr:null);d&524288&&(b.onpaste=c&524288?Vr:null);d&1048576&&(b.ontouchstart=c&1048576?Vr:null);d&2097152&&(b.ontouchmove=c&2097152?Vr:null);d&4194304&&(b.ontouchend=c&4194304?Vr:null);d&8388608&&(b.ontouchcancel=c&8388608?Vr:null);d&16777216&&(b.ongesturestart=c&16777216?Vr:null);d&33554432&&(b.ongesturechange=c&33554432?Vr:null);d&67108864&&(b.ongestureend=c&67108864?Vr:null)}
var EA='',KA='\n',dB=' ',hB='#000',iB='#F0F',GA='(',fB='(Unknown Source',gB=')',XB=', ',eB='.',SB='0',qB='1',JA=':',DA=': ',CB='=',QA='BODY',SA='CSS1Compat',rB='Minimize',xB='PhoneGap',FA='String',gC='UmbrellaException',MA='[',bC='[Lcom.google.gwt.dom.client.',_B='[Ljava.lang.',yB=']',jB='__GWT_LOG_FORMATTER_BR__',RA='absolute',OB='align',IA='anonymous',LA='at ',TB='cellPadding',RB='cellSpacing',pB='className',TA='click',ZB='com.google.gwt.core.client.',$B='com.google.gwt.core.client.impl.',aC='com.google.gwt.dom.client.',eC='com.google.gwt.event.dom.client.',fC='com.google.gwt.event.logical.shared.',dC='com.google.gwt.event.shared.',iC='com.google.gwt.logging.client.',jC='com.google.gwt.logging.impl.',mC='com.google.gwt.mobile.phonegap.',nC='com.google.gwt.mobile.phonegap.factory.impl.',oC='com.google.gwt.mobile.phonegap.resources.',pC='com.google.gwt.touch.client.',qC='com.google.gwt.user.client.',rC='com.google.gwt.user.client.impl.',kC='com.google.gwt.user.client.ui.',cC='com.google.web.bindery.event.shared.',DB='dblclick',aB='dir',UB='display',ZA='div',PA='fixed',HA='function',WB='g',LB='gesturechange',MB='gestureend',KB='gesturestart',mB='height',YB='java.lang.',lC='java.util.',hC='java.util.logging.',EB='keydown',FB='keypress',GB='keyup',nB='left',bB='ltr',UA='mousedown',VA='mousemove',HB='mouseout',IB='mouseover',WA='mouseup',JB='mousewheel',BB='msie',sC='nl.isaac.labs.mobile.client.',sB='none',AB='opera',uB='overflow',OA='position',lB='px',vB='relative',NA='rtl',cB='safari',zB='scrollLeft',tB='scrollTop',NB='td',oB='top',XA='touchcancel',YA='touchend',$A='touchmove',_A='touchstart',QB='tr',PB='verticalAlign',VB='visible',kB='width',wB='zoom';var _,BA={l:0,m:0,h:0};_=v.prototype={};_.eQ=function w(b){return this===b};_.gC=function x(){return Mj};_.hC=function y(){return this.$H||(this.$H=++fb)};_.tS=function z(){return this.gC().c+'@'+_v(this.hC())};_.toString=function(){return this.tS()};_.tM=AA;_.cM={};_=u.prototype=new v;_.gC=function B(){return Sg};_.cM={};_.g=false;_.i=false;_=E.prototype=C.prototype=new v;_.gC=function F(){return Tg};_.cM={};var G=null;_=K.prototype=new v;_.gC=function N(){return Sj};_.A=function O(){return this.g};_.tS=function P(){var b,c;b=this.gC().c;c=this.A();return c!=null?b+DA+c:b};_.cM={2:1,44:1};_.f=null;_.g=null;_.i=null;_=J.prototype=new K;_.gC=function Q(){return Hj};_.cM={2:1,44:1};_=I.prototype=new J;_.gC=function S(){return Nj};_.cM={2:1,3:1,44:1};_=T.prototype=H.prototype=new I;_.gC=function U(){return Ug};_.A=function X(){this.d==null&&(this.e=Y(this.c),this.b=V(this.c),this.d=GA+this.e+'): '+this.b+$(this.c),undefined);return this.d};_.cM={2:1,3:1,44:1};_.b=null;_.c=null;_.d=null;_.e=null;_=cb.prototype=new v;_.gC=function db(){return Wg};_.cM={};var eb=0,fb=0;_=pb.prototype=kb.prototype=new cb;_.gC=function rb(){return Xg};_.cM={};_.b=null;_.c=null;var lb;_=Cb.prototype=xb.prototype=new v;_.B=function Db(){var b={};var c=[];var d=arguments.callee.caller.caller;while(d){var e=this.C(d.toString());c.push(e);var f=JA+e;var g=b[f];if(g){var i,j;for(i=0,j=g.length;i<j;i++){if(g[i]===d){return c}}}(g||(b[f]=[])).push(d);d=d.caller}return c};_.C=function Eb(b){return vb(b)};_.gC=function Fb(){return $g};_.D=function Gb(b){return []};_.cM={};_=Ib.prototype=new xb;_.B=function Kb(){return wb(this.D(Bb()),this.E())};_.gC=function Lb(){return Zg};_.D=function Mb(b){return Jb(this,b)};_.E=function Nb(){return 2};_.cM={};_=Qb.prototype=Hb.prototype=new Ib;_.B=function Rb(){return Ob(this)};_.C=function Sb(b){var c,d;if(b.length==0){return IA}d=rw(b);d.indexOf(LA)==0&&(d=d.substr(3,d.length-3));c=d.indexOf(MA);c==-1&&(c=d.indexOf(GA));if(c==-1){return IA}else{d=rw(d.substr(0,c-0))}c=d.indexOf(String.fromCharCode(46));c!=-1&&(d=d.substr(c+1,d.length-(c+1)));return d.length>0?d:IA};_.gC=function Tb(){return Yg};_.D=function Ub(b){return Pb(this,b)};_.E=function Vb(){return 3};_.cM={};_=Wb.prototype=new v;_.gC=function Xb(){return ah};_.cM={};_=Zb.prototype=Yb.prototype=new Wb;_.gC=function $b(){return _g};_.cM={};_.b=EA;_=rc.prototype=new v;_.eQ=function sc(b){return this===b};_.gC=function tc(){return Gj};_.hC=function uc(){return this.$H||(this.$H=++fb)};_.tS=function vc(){return this.b};_.cM={44:1,46:1,47:1};_.b=null;_.c=0;_=qc.prototype=new rc;_.gC=function Cc(){return fh};_.cM={34:1,35:1,44:1,46:1,47:1};var wc,xc,yc,zc,Ac;_=Fc.prototype=Ec.prototype=new qc;_.gC=function Gc(){return bh};_.cM={34:1,35:1,44:1,46:1,47:1};_=Ic.prototype=Hc.prototype=new qc;_.gC=function Jc(){return ch};_.cM={34:1,35:1,44:1,46:1,47:1};_=Lc.prototype=Kc.prototype=new qc;_.gC=function Mc(){return dh};_.cM={34:1,35:1,44:1,46:1,47:1};_=Oc.prototype=Nc.prototype=new qc;_.gC=function Pc(){return eh};_.cM={34:1,35:1,44:1,46:1,47:1};_=Qc.prototype=new rc;_.gC=function ad(){return ph};_.cM={36:1,44:1,46:1,47:1};var Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c;_=dd.prototype=cd.prototype=new Qc;_.gC=function ed(){return gh};_.cM={36:1,44:1,46:1,47:1};_=gd.prototype=fd.prototype=new Qc;_.gC=function hd(){return hh};_.cM={36:1,44:1,46:1,47:1};_=jd.prototype=id.prototype=new Qc;_.gC=function kd(){return ih};_.cM={36:1,44:1,46:1,47:1};_=md.prototype=ld.prototype=new Qc;_.gC=function nd(){return jh};_.cM={36:1,44:1,46:1,47:1};_=pd.prototype=od.prototype=new Qc;_.gC=function qd(){return kh};_.cM={36:1,44:1,46:1,47:1};_=sd.prototype=rd.prototype=new Qc;_.gC=function td(){return lh};_.cM={36:1,44:1,46:1,47:1};_=vd.prototype=ud.prototype=new Qc;_.gC=function wd(){return mh};_.cM={36:1,44:1,46:1,47:1};_=yd.prototype=xd.prototype=new Qc;_.gC=function zd(){return nh};_.cM={36:1,44:1,46:1,47:1};_=Bd.prototype=Ad.prototype=new Qc;_.gC=function Cd(){return oh};_.cM={36:1,44:1,46:1,47:1};_=Id.prototype=new v;_.gC=function Jd(){return wj};_.tS=function Kd(){return 'An event type'};_.cM={};_.g=null;_=Hd.prototype=new Id;_.gC=function Ld(){return Jh};_.H=function Md(){this.f=false;this.g=null};_.cM={};_.f=false;_=Gd.prototype=new Hd;_.G=function Pd(){return this.I()};_.gC=function Qd(){return sh};_.cM={};_.b=null;_.c=null;var Nd=null;_=Fd.prototype=new Gd;_.gC=function Rd(){return th};_.cM={};_=Ed.prototype=new Fd;_.gC=function Sd(){return vh};_.cM={};_=Vd.prototype=Dd.prototype=new Ed;_.F=function Wd(b){Ng(b,4).J(this)};_.I=function Xd(){return Td};_.gC=function Yd(){return qh};_.cM={};var Td;_=_d.prototype=new v;_.gC=function be(){return uj};_.hC=function ce(){return this.d};_.tS=function de(){return 'Event type'};_.cM={};_.d=0;var ae=0;_=ee.prototype=$d.prototype=new _d;_.gC=function fe(){return Ih};_.cM={};_=ge.prototype=Zd.prototype=new $d;_.gC=function he(){return rh};_.cM={5:1};_.b=null;_.c=null;_=le.prototype=ie.prototype=new Ed;_.F=function me(b){Ng(b,6).K(this)};_.I=function ne(){return je};_.gC=function oe(){return uh};_.cM={};var je;_=se.prototype=pe.prototype=new Ed;_.F=function te(b){Ng(b,7).L(this)};_.I=function ue(){return qe};_.gC=function ve(){return wh};_.cM={};var qe;_=ze.prototype=we.prototype=new Ed;_.F=function Ae(b){Ng(b,8).M(this)};_.I=function Be(){return xe};_.gC=function Ce(){return xh};_.cM={};var xe;_=Ee.prototype=De.prototype=new v;_.gC=function Fe(){return yh};_.cM={};_.b=null;_=He.prototype=new Fd;_.gC=function Je(){return Ch};_.cM={};var Ie=null;_=Me.prototype=Ge.prototype=new He;_.F=function Ne(b){iq(Ng(Ng(b,9),10).b)};_.I=function Oe(){return Ke};_.gC=function Pe(){return zh};_.cM={};var Ke;_=Te.prototype=Qe.prototype=new He;_.F=function Ue(b){iq(Ng(Ng(b,11),12).b)};_.I=function Ve(){return Re};_.gC=function We(){return Ah};_.cM={};var Re;_=Ye.prototype=Xe.prototype=new v;_.gC=function Ze(){return Bh};_.cM={};_=bf.prototype=$e.prototype=new He;_.F=function cf(b){jq(Ng(b,13).b,this)};_.I=function df(){return _e};_.gC=function ef(){return Dh};_.cM={};var _e;_=jf.prototype=ff.prototype=new He;_.F=function kf(b){kq(Ng(b,14).b,this)};_.I=function lf(){return gf};_.gC=function mf(){return Eh};_.cM={};var gf;_=pf.prototype=nf.prototype=new Hd;_.F=function qf(b){Ng(b,15);qu()};_.G=function sf(){return of};_.gC=function tf(){return Fh};_.cM={};var of=null;_=wf.prototype=uf.prototype=new Hd;_.F=function xf(b){Ng(b,16).N(this)};_.G=function zf(){return vf};_.gC=function Af(){return Gh};_.cM={};var vf=null;_=Ef.prototype=Bf.prototype=new Hd;_.F=function Ff(b){Df(Ng(b,17))};_.G=function Hf(){return Cf};_.gC=function If(){return Hh};_.cM={};var Cf=null;_=Mf.prototype=Lf.prototype=Jf.prototype=new v;_.O=function Nf(b){Kf(this,b)};_.gC=function Of(){return Lh};_.cM={38:1};_.b=null;_.c=null;_=Rf.prototype=new v;_.gC=function Sf(){return vj};_.cM={};_=Qf.prototype=new Rf;_.P=function _f(b,c,d){this.c>0?Tf(this,new rv(this,b,d)):Xf(this,b,d)};_.gC=function ag(){return Aj};_.cM={};_.b=null;_.c=0;_.d=false;_=bg.prototype=Pf.prototype=new Qf;_.P=function cg(b,c,d){this.c>0?Tf(this,new rv(this,b,d)):Xf(this,b,d)};_.gC=function dg(){return Kh};_.cM={};_=fg.prototype=eg.prototype=new v;_.gC=function gg(){return Mh};_.cM={23:1};_.b=null;_=jg.prototype=ig.prototype=new I;_.gC=function kg(){return Bj};_.cM={2:1,3:1,18:1,44:1};_.b=null;_=lg.prototype=hg.prototype=new ig;_.gC=function mg(){return Nh};_.cM={2:1,3:1,18:1,44:1};_=wg.prototype=qg.prototype=new rc;_.gC=function xg(){return Oh};_.cM={39:1,44:1,46:1,47:1};var rg,sg,tg,ug;_=Ag.prototype=zg.prototype=new v;_.gC=function Dg(){return this.aC};_.cM={};_.aC=null;_.qI=0;var Hg,Ig;var Hk=-1;var Ok=null;var Xk,Yk,Zk;_=al.prototype=_k.prototype=new v;_.gC=function bl(){return Ph};_.cM={40:1};_=el.prototype=new v;_.gC=function gl(){return ok};_.cM={21:1};_.c=null;_.d=null;_=hl.prototype=dl.prototype=new el;_.gC=function il(){return Qh};_.Q=function jl(b){var c;if(!(window.console!=null&&window.console.firebug==null&&window.console.log!=null&&typeof window.console.log==HA)||fl(this).b.c>b.b.b.c){return}c=this.c.R(b);window.console.log(c)};_.cM={21:1};_=ll.prototype=kl.prototype=new el;_.gC=function ml(){return Rh};_.Q=function nl(b){return};_.cM={21:1};_=pl.prototype=ol.prototype=new el;_.gC=function ql(){return Sh};_.Q=function rl(b){var c,d;if(!(window.console&&window.console.firebug)||fl(this).b.c>b.b.b.c){return}c=this.c.R(b);d=b.b.b.c;d<=(_n(),Un).b.c?(window.console.debug(c),undefined):d<$n.b.c?(window.console.info(c),undefined):d<Zn.b.c?(window.console.warn(c),undefined):(window.console.error(c),undefined)};_.cM={21:1};_=tl.prototype=sl.prototype=new el;_.gC=function ul(){return Th};_.Q=function vl(b){var c,d;if(fl(this).b.c>b.b.b.c){return}c=this.c;d=c.R(b);c!=null&&c.cM&&!!c.cM[19]?Km(this.b,new ot(d)):Km(this.b,new lt(d))};_.cM={21:1};_.b=null;_=yl.prototype=new v;_.gC=function zl(){return nk};_.cM={};_=xl.prototype=new yl;_.gC=function Cl(){return fi};_.cM={};_=Gl.prototype=wl.prototype=new xl;_.R=function Hl(b){var c;c=new Ow(Fl(b));Mw(c,Fl(b));Mw(c,Al(b,dB));Mw(c,El(b.e));this.b&&Mw(c,El(Bl(b.f,jB,'&nbsp;&nbsp;&nbsp;')));c.b.b+='<\/code><\/span>';return c.b.b};_.gC=function Il(){return Uh};_.cM={19:1};_.b=false;var Jl;_=Ol.prototype=Ml.prototype=new v;_.gC=function Pl(){return Vh};_.cM={};_.b=null;_=Vl.prototype=Ql.prototype=new v;_.gC=function Wl(){return Wh};_.cM={};_.b=null;_=am.prototype=new v;_.gC=function cm(){return pj};_.tS=function dm(){if(!this.z){return '(null handle)'}return this.z.outerHTML};_.cM={43:1};_.z=null;_=_l.prototype=new am;_.S=function lm(){};_.T=function mm(){};_.O=function nm(b){!!this.x&&Kf(this.x,b)};_.gC=function om(){return tj};_.U=function pm(){gm(this)};_.V=function qm(b){var c;switch(Pr(b.type)){case 16:case 32:c=b.relatedTarget;if(!!c&&hc(this.z,c)){return}}Od(b,this,this.z)};_.W=function rm(){};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.v=false;_.w=0;_.x=null;_.y=null;_=$l.prototype=new _l;_.S=function sm(){Is(this,(Fs(),Ds))};_.T=function tm(){Is(this,(Fs(),Es))};_.gC=function um(){return bj};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=Zl.prototype=new $l;_.gC=function xm(){return oj};_.Y=function ym(){return this.z};_.Z=function zm(){return new Ku(this)};_.X=function Am(b){return vm(this,b)};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.u=null;_=Yl.prototype=new Zl;_.gC=function Hm(){return gj};_.Y=function Im(){return bc(this.z)};_.W=function Jm(){this.s&&gu(this.r,false,true)};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.e=false;_.f=false;_.g=null;_.j=null;_.k=false;_.n=-1;_.o=false;_.p=null;_.q=false;_.s=false;_.t=-1;_=Lm.prototype=Xl.prototype=new Yl;_.gC=function Mm(){return bi};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.b=null;_.c=null;_.d=null;_=Om.prototype=Nm.prototype=new v;_.gC=function Pm(){return Yh};_.J=function Qm(b){if(mw(this.c.z.textContent,rB)){this.c.z.textContent='Maximize';this.b.d.z.style.display=sB;this.b.c.z.style.display=sB}else{this.b.d.z.style.display=EA;this.b.c.z.style.display=EA;this.c.z.textContent=rB}};_.cM={4:1,28:1};_.b=null;_.c=null;_=Rm.prototype=new v;_.gC=function Tm(){return Zh};_.K=function Um(b){this.f=true;$q(this.c.z);this.d=b.b.clientX||0;this.e=b.b.clientY||0;Vq.preventDefault()};_.L=function Vm(b){if(this.f){this.$((b.b.clientX||0)-this.d,(b.b.clientY||0)-this.e);this.d=b.b.clientX||0;this.e=b.b.clientY||0}};_.M=function Wm(b){this.f=false;Zq(this.c.z)};_.cM={6:1,7:1,8:1,28:1};_.c=null;_.d=0;_.e=0;_.f=false;_=Ym.prototype=new Zl;_.gC=function bn(){return mj};_.Y=function cn(){return this.d};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.d=null;
--></script>
<script><!--
_.e=null;var Zm=null;_=fn.prototype=Xm.prototype=new Ym;_.gC=function gn(){return $h};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.b=0;_.c=0;_=jn.prototype=hn.prototype=new Rm;_.gC=function kn(){return _h};_.$=function ln(b,c){var d;d=this.b;ws((nu(),ru()),d,dc(d.z)+b,ec(d.z)+c)};_.cM={6:1,7:1,8:1,28:1};_.b=null;_=nn.prototype=mn.prototype=new Rm;_.gC=function on(){return ai};_.$=function pn(b,c){dn(this.b.d,b,c)};_.cM={6:1,7:1,8:1,28:1};_.b=null;_=rn.prototype=qn.prototype=new el;_.gC=function sn(){return ci};_.Q=function tn(b){};_.cM={21:1};_=vn.prototype=un.prototype=new el;_.gC=function wn(){return di};_.Q=function xn(b){return};_.cM={21:1};_=zn.prototype=yn.prototype=new xl;_.R=function An(b){var c;c=new Nw;Mw(c,Al(b,KA));Mw(c,b.e);this.b&&Mw(c,Bl(b.f,KA,'\t'));return c.b.b};_.gC=function Bn(){return ei};_.cM={};_.b=false;_=Nn.prototype=Cn.prototype=new v;_.gC=function On(){return hi};_.tS=function Pn(){return this.b};_.cM={};_.b=null;_.c=0;var Dn,En,Fn,Gn,Hn,In,Jn,Kn,Ln;_=Rn.prototype=new v;_.gC=function ao(){return pk};_.tS=function bo(){return this.b.b};_.cM={44:1};_.b=null;var Sn,Tn,Un,Vn,Wn,Xn,Yn,Zn,$n;_=co.prototype=Qn.prototype=new Rn;_.gC=function eo(){return gi};_.cM={44:1};_=mo.prototype=fo.prototype=new v;_.gC=function no(){return ii};_.cM={};_.b=null;_.c=null;_.d=null;_.e=null;_.f=false;_=ro.prototype=po.prototype=new v;_.gC=function so(){return tk};_.cM={20:1};_.b=null;_=to.prototype=oo.prototype=new po;_.gC=function uo(){return ji};_.cM={20:1};_=Bo.prototype=vo.prototype=new rc;_.gC=function Co(){return ki};_.cM={41:1,44:1,46:1,47:1};var wo,xo,yo,zo;var Eo,Fo=false,Go;_=Mo.prototype=Lo.prototype=new v;_.gC=function No(){return li};_._=function Oo(){var b;jo((Ho(),Go).b,(_n(),Xn),'Dispatching device ready event.',null);jo(pA.b,Xn,'Device ready.',null);b=new Xs('Run');b.z.style[mB]='100px';b.z.style[kB]='200px';em(b,new xA,(Ud(),Ud(),Td));ts((nu(),ru()),b)};_.cM={};_=Ro.prototype=new v;_.gC=function To(){return mi};_.cM={};_=Vo.prototype=Uo.prototype=new Ro;_.gC=function Wo(){return ni};_.bb=function Xo(){return Ao(),xo};_.cb=function Yo(){return Ho(),Fo?(Ip(),kp):(Jp(),lp)};_.cM={};_=$o.prototype=Zo.prototype=new Ro;_.gC=function _o(){return oi};_.bb=function ap(){return Ao(),zo};_.cb=function bp(){return null};_.cM={};_=dp.prototype=cp.prototype=new Ro;_.gC=function ep(){return pi};_.bb=function fp(){return Ao(),yo};_.cb=function gp(){return Ho(),Fo?(Kp(),mp):(Lp(),np)};_.cM={};var hp=null;var kp=null,lp=null,mp=null,np=null;_=pp.prototype=op.prototype=new v;_.gC=function qp(){return qi};_.db=function rp(){return 'android_096'};
--></script>
<script><!--
_.eb=function sp(){var b;b=new Nw;b.b.b+='/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (typeof PhoneGap === "undefined") {\n\n/**\n * The order of events during page load and PhoneGap startup is as follows:\n *\n * onDOMContentLoaded         Internal event that is received when the web page is loaded and parsed.\n * window.onload              Body onload event.\n * onNativeReady              Internal event that indicates the PhoneGap native side is ready.\n * onPhoneGapInit             Internal event that kicks off creation of all PhoneGap JavaScript objects (runs constructors).\n * onPhoneGapReady            Internal event fired when all PhoneGap JavaScript objects have been created\n * onPhoneGapInfoReady        Internal event fired when device properties are available\n * onDeviceReady              User event fired to indicate that PhoneGap is ready\n * onResume                   User event fired to indicate a start/resume lifecycle event\n * onPause                    User event fired to indicate a pause lifecycle event\n * onDestroy                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).\n *\n * The only PhoneGap events that user code should register for are:\n *      onDeviceReady\n *      onResume\n *\n * Listeners can be registered as:\n *      document.addEventListener("deviceready", myDeviceReadyListener, false);\n *      document.addEventListener("resume", myResumeListener, false);\n *      document.addEventListener("pause", myPauseListener, false);\n */\n\nif (typeof(DeviceInfo) !== \'object\') {\n    var DeviceInfo = {};\n}\n\n/**\n * This represents the PhoneGap API itself, and provides a global namespace for accessing\n * information about the state of PhoneGap.\n * @class\n */\nvar PhoneGap = {\n    queue: {\n        ready: true,\n        commands: [],\n        timer: null\n    }\n};\n\n/**\n * List of resource files loaded by PhoneGap.\n * This is used to ensure JS and other files are loaded only once.\n */\nPhoneGap.resources = {base: true};\n\n/**\n * Determine if resource has been loaded by PhoneGap\n *\n * @param name\n * @return\n */\nPhoneGap.hasResource = function(name) {\n    return PhoneGap.resources[name];\n};\n\n/**\n * Add a resource to list of loaded resources by PhoneGap\n *\n * @param name\n */\nPhoneGap.addResource = function(name) {\n    PhoneGap.resources[name] = true;\n};\n\n/**\n * Custom pub-sub channel that can have functions subscribed to it\n * @constructor\n */\nPhoneGap.Channel = function (type)\n{\n    this.type = type;\n    this.handlers = {};\n    this.guid = 0;\n    this.fired = false;\n    this.enabled = true;\n};\n\n/**\n * Subscribes the given function to the channel. Any time that\n * Channel.fire is called so too will the function.\n * Optionally specify an execution context for the function\n * and a guid that can be used to stop subscribing to the channel.\n * Returns the guid.\n */\nPhoneGap.Channel.prototype.subscribe = function(f, c, g) {\n    // need a function to call\n    if (f === null) { return; }\n\n    var func = f;\n    if (typeof c === "object" && typeof f === "function") { func = PhoneGap.close(c, f); }\n\n    g = g || func.observer_guid || f.observer_guid || this.guid++;\n    func.observer_guid = g;\n    f.observer_guid = g;\n    this.handlers[g] = func;\n    return g;\n};\n\n/**\n * Like subscribe but the function is only called once and then it\n * auto-unsubscribes itself.\n */\nPhoneGap.Channel.prototype.subscribeOnce = function(f, c) {\n    var g = null;\n    var _this = this;\n    var m = function() {\n        f.apply(c || null, arguments);\n        _this.unsubscribe(g);\n    };\n    if (this.fired) {\n        if (typeof c === "object" && typeof f === "function") { f = PhoneGap.close(c, f); }\n        f.apply(this, this.fireArgs);\n    } else {\n        g = this.subscribe(m);\n    }\n    return g;\n};\n\n/**\n * Unsubscribes the function with the given guid from the channel.\n */\nPhoneGap.Channel.prototype.unsubscribe = function(g) {\n    if (typeof g === "function") { g = g.observer_guid; }\n    this.handlers[g] = null;\n    delete this.handlers[g];\n};\n\n/**\n * Calls all functions subscribed to this channel.\n */\nPhoneGap.Channel.prototype.fire = function(e) {\n    if (this.enabled) {\n        var fail = false;\n        var item, handler, rv;\n        for (item in this.handlers) {\n            if (this.handlers.hasOwnProperty(item)) {\n                handler = this.handlers[item];\n                if (typeof handler === "function") {\n                    rv = (handler.apply(this, arguments) === false);\n                    fail = fail || rv;\n                }\n            }\n        }\n        this.fired = true;\n        this.fireArgs = arguments;\n        return !fail;\n    }\n    return true;\n};\n\n/**\n * Calls the provided function only after all of the channels specified\n * have been fired.\n */\nPhoneGap.Channel.join = function(h, c) {\n    var i = c.length;\n    var f = function() {\n        if (!(--i)) {\n            h();\n        }\n    };\n    var len = i;\n    var j;\n    for (j=0; j<len; j++) {\n        if (!c[j].fired) {\n            c[j].subscribeOnce(f);\n        }\n        else {\n            i--;\n        }\n    }\n    if (!i) {\n        h();\n    }\n};\n\n/**\n * Boolean flag indicating if the PhoneGap API is available and initialized.\n */ // TODO: Remove this, it is unused here ... -jm\nPhoneGap.available = DeviceInfo.uuid !== undefined;\n\n/**\n * Add an initialization function to a queue that ensures it will run and initialize\n * application constructors only once PhoneGap has been initialized.\n * @param {Function} func The function callback you want run once PhoneGap is initialized\n */\nPhoneGap.addConstructor = function(func) {\n    PhoneGap.onPhoneGapInit.subscribeOnce(function() {\n        try {\n            func();\n        } catch(e) {\n            console.log("Failed to run constructor: " + e);\n        }\n    });\n};\n\n/**\n * Plugins object\n */\nif (!window.plugins) {\n    window.plugins = {};\n}\n\n/**\n * Adds a plugin object to window.plugins.\n * The plugin is accessed using window.plugins.<name>\n *\n * @param name          The plugin name\n * @param obj           The plugin object\n */\nPhoneGap.addPlugin = function(name, obj) {\n    if (!window.plugins[name]) {\n        window.plugins[name] = obj;\n    }\n    else {\n        console.log("Error: Plugin "+name+" already exists.");\n    }\n};\n\n/**\n * onDOMContentLoaded channel is fired when the DOM content\n * of the page has been parsed.\n */\nPhoneGap.onDOMContentLoaded = new PhoneGap.Channel(\'onDOMContentLoaded\');\n\n/**\n * onNativeReady channel is fired when the PhoneGap native code\n * has been initialized.\n */\nPhoneGap.onNativeReady = new PhoneGap.Channel(\'onNativeReady\');\n\n/**\n * onPhoneGapInit channel is fired when the web page is fully loaded and\n * PhoneGap native code has been initialized.\n */\nPhoneGap.onPhoneGapInit = new PhoneGap.Channel(\'onPhoneGapInit\');\n\n/**\n * onPhoneGapReady channel is fired when the JS PhoneGap objects have been created.\n */\nPhoneGap.onPhoneGapReady = new PhoneGap.Channel(\'onPhoneGapReady\');\n\n/**\n * onPhoneGapInfoReady channel is fired when the PhoneGap device properties\n * has been set.\n */\nPhoneGap.onPhoneGapInfoReady = new PhoneGap.Channel(\'onPhoneGapInfoReady\');\n\n/**\n * onPhoneGapConnectionReady channel is fired when the PhoneGap connection properties\n * has been set.\n */\nPhoneGap.onPhoneGapConnectionReady = new PhoneGap.Channel(\'onPhoneGapConnectionReady\');\n\n/**\n * onResume channel is fired when the PhoneGap native code\n * resumes.\n */\nPhoneGap.onResume = new PhoneGap.Channel(\'onResume\');\n\n/**\n * onPause channel is fired when the PhoneGap native code\n * pauses.\n */\nPhoneGap.onPause = new PhoneGap.Channel(\'onPause\');\n\n/**\n * onDestroy channel is fired when the PhoneGap native code\n * is destroyed.  It is used internally.\n * Window.onunload should be used by the user.\n */\nPhoneGap.onDestroy = new PhoneGap.Channel(\'onDestroy\');\nPhoneGap.onDestroy.subscribeOnce(function() {\n    PhoneGap.shuttingDown = true;\n});\nPhoneGap.shuttingDown = false;\n\n// _nativeReady is global variable that the native side can set\n// to signify that the native code is ready. It is a global since\n// it may be called before any PhoneGap JS is ready.\nif (typeof _nativeReady !== \'undefined\') { PhoneGap.onNativeReady.fire(); }\n\n/**\n * onDeviceReady is fired only after all PhoneGap objects are created and\n * the device properties are set.\n */\nPhoneGap.onDeviceReady = new PhoneGap.Channel(\'onDeviceReady\');\n\n\n// Array of channels that must fire before "deviceready" is fired\nPhoneGap.deviceReadyChannelsArray = [ PhoneGap.onPhoneGapReady, PhoneGap.onPhoneGapInfoReady, PhoneGap.onPhoneGapConnectionReady];\n\n// Hashtable of user defined channels that must also fire before "deviceready" is fired\nPhoneGap.deviceReadyChannelsMap = {};\n\n/**\n * Indicate that a feature needs to be initialized before it is ready to be used.\n * This holds up PhoneGap\'s "deviceready" event until the feature has been initialized\n * and PhoneGap.initComplete(feature) is called.\n *\n * @param feature {String}     The unique feature name\n */\nPhoneGap.waitForInitialization = function(feature) {\n    if (feature) {\n        var channel = new PhoneGap.Channel(feature);\n        PhoneGap.deviceReadyChannelsMap[feature] = channel;\n        PhoneGap.deviceReadyChannelsArray.push(channel);\n    }\n};\n\n/**\n * Indicate that initialization code has completed and the feature is ready to be used.\n *\n * @param feature {String}     The unique feature name\n */\nPhoneGap.initializationComplete = function(feature) {\n    var channel = PhoneGap.deviceReadyChannelsMap[feature];\n    if (channel) {\n        channel.fire();\n    }\n};\n\n/**\n * Create all PhoneGap objects once page has fully loaded and native side is ready.\n */\nPhoneGap.Channel.join(function() {\n\n    // Start listening for XHR callbacks\n    setTimeout(function() {\n            if (PhoneGap.UsePolling) {\n                PhoneGap.JSCallbackPolling();\n            }\n            else {\n                var polling = prompt("usePolling", "gap_callbackServer:");\n                PhoneGap.UsePolling = polling;\n                if (polling == "true") {\n                    PhoneGap.UsePolling = true;\n                    PhoneGap.JSCallbackPolling();\n                }\n                else {\n                    PhoneGap.UsePolling = false;\n                    PhoneGap.JSCallback();\n                }\n            }\n        }, 1);\n\n    // Run PhoneGap constructors\n    PhoneGap.onPhoneGapInit.fire();\n\n    // Fire event to notify that all objects are created\n    PhoneGap.onPhoneGapReady.fire();\n\n    // Fire onDeviceReady event once all constructors have run and PhoneGap info has been\n    // received from native side, and any user defined initialization channels.\n    PhoneGap.Channel.join(function() {\n\n        // Turn off app loading dialog\n        navigator.notification.activityStop();\n\n        PhoneGap.onDeviceReady.fire();\n\n        // Fire the onresume event, since first one happens before JavaScript is loaded\n        PhoneGap.onResume.fire();\n    }, PhoneGap.deviceReadyChannelsArray);\n\n}, [ PhoneGap.onDOMContentLoaded, PhoneGap.onNativeReady ]);\n\n// Listen for DOMContentLoaded and notify our channel subscribers\ndocument.addEventListener(\'DOMContentLoaded\', function() {\n    PhoneGap.onDOMContentLoaded.fire();\n}, false);\n\n// Intercept calls to document.addEventListener and watch for deviceready\nPhoneGap.m_document_addEventListener = document.addEventListener;\n\ndocument.addEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (e === \'deviceready\') {\n        PhoneGap.onDeviceReady.subscribeOnce(handler);\n    } else if (e === \'resume\') {\n        PhoneGap.onResume.subscribe(handler);\n        if (PhoneGap.onDeviceReady.fired) {\n            PhoneGap.onResume.fire();\n        }\n    } else if (e === \'pause\') {\n        PhoneGap.onPause.subscribe(handler);\n    }\n    else {\n        // If subscribing to Android backbutton\n        if (e === \'backbutton\') {\n            PhoneGap.exec(null, null, "App", "overrideBackbutton", [true]);\n        }\n\n        PhoneGap.m_document_addEventListener.call(document, evt, handler, capture);\n    }\n};\n\n// Intercept calls to document.removeEventListener and watch for events that\n// are generated by PhoneGap native code\nPhoneGap.m_document_removeEventListener = document.removeEventListener;\n\ndocument.removeEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n\n    // If unsubscribing to Android backbutton\n    if (e === \'backbutton\') {\n        PhoneGap.exec(null, null, "App", "overrideBackbutton", [false]);\n    }\n\n    PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture);\n};\n\n/**\n * Method to fire event from native code\n */\nPhoneGap.fireEvent = function(type) {\n    var e = document.createEvent(\'Events\');\n    e.initEvent(type);\n    document.dispatchEvent(e);\n};\n\n/**\n * If JSON not included, use our own stringify. (Android 1.6)\n * The restriction on ours is that it must be an array of simple types.\n *\n * @param args\n * @return {String}\n */\nPhoneGap.stringify = function(args) {\n    if (typeof JSON === "undefined") {\n        var s = "[";\n        var i, type, start, name, nameType, a;\n        for (i = 0; i < args.length; i++) {\n            if (args[i] !== null) {\n                if (i > 0) {\n                    s = s + ",";\n                }\n                type = typeof args[i];\n                if ((type === "number") || (type === "boolean")) {\n                    s = s + args[i];\n                } else if (args[i] instanceof Array) {\n                    s = s + "[" + args[i] + "]";\n                } else if (args[i] instanceof Object) {\n                    start = true;\n                    s = s + \'{\';\n                    for (name in args[i]) {\n                        if (args[i][name] !== null) {\n                            if (!start) {\n                                s = s + \',\';\n                            }\n                            s = s + \'"\' + name + \'":\';\n                            nameType = typeof args[i][name];\n                            if ((nameType === "number") || (nameType === "boolean")) {\n                                s = s + args[i][name];\n                            } else if ((typeof args[i][name]) === \'function\') {\n                                // don\'t copy the functions\n                                s = s + \'""\';\n                            } else if (args[i][name] instanceof Object) {\n                                s = s + PhoneGap.stringify(args[i][name]);\n                            } else {\n                                s = s + \'"\' + args[i][name] + \'"\';\n                            }\n                            start = false;\n                        }\n                    }\n                    s = s + \'}\';\n                } else {\n                    a = args[i].replace(/\\\\/g, \'\\\\\\\\\');\n                    a = a.replace(/"/g, \'\\\\"\');\n                    s = s + \'"\' + a + \'"\';\n                }\n            }\n        }\n        s = s + "]";\n        return s;\n    } else {\n        return JSON.stringify(args);\n    }\n};\n\n/**\n * Does a deep clone of the object.\n *\n * @param obj\n * @return {Object}\n */\nPhoneGap.clone = function(obj) {\n    var i, retVal;\n    if(!obj) { \n        return obj;\n    }\n    \n    if(obj instanceof Array){\n        retVal = [];\n        for(i = 0; i < obj.length; ++i){\n            retVal.push(PhoneGap.clone(obj[i]));\n        }\n        return retVal;\n    }\n    \n    if (typeof obj === "function") {\n        return obj;\n    }\n    \n    if(!(obj instanceof Object)){\n        return obj;\n    }\n    \n    if (obj instanceof Date) {\n        return obj;\n    }\n    \n    retVal = {};\n    for(i in obj){\n        if(!(i in retVal) || retVal[i] !== obj[i]) {\n            retVal[i] = PhoneGap.clone(obj[i]);\n        }\n    }\n    return retVal;\n};\n\nPhoneGap.callbackId = 0;\nPhoneGap.callbacks = {};\nPhoneGap.callbackStatus = {\n    NO_RESULT: 0,\n    OK: 1,\n    CLASS_NOT_FOUND_EXCEPTION: 2,\n    ILLEGAL_ACCESS_EXCEPTION: 3,\n    INSTANTIATION_EXCEPTION: 4,\n    MALFORMED_URL_EXCEPTION: 5,\n    IO_EXCEPTION: 6,\n    INVALID_ACTION: 7,\n    JSON_EXCEPTION: 8,\n    ERROR: 9\n    };\n\n\n/**\n * Execute a PhoneGap command.  It is up to the native side whether this action is synch or ';b.b.b+='async.\n * The native side can return:\n *      Synchronous: PluginResult object as a JSON string\n *      Asynchrounous: Empty string ""\n * If async, the native side will PhoneGap.callbackSuccess or PhoneGap.callbackError,\n * depending upon the result of the action.\n *\n * @param {Function} success    The success callback\n * @param {Function} fail       The fail callback\n * @param {String} service      The name of the service to use\n * @param {String} action       Action to be run in PhoneGap\n * @param {Array.<String>} [args]     Zero or more arguments to pass to the method\n */\nPhoneGap.exec = function(success, fail, service, action, args) {\n    try {\n        var callbackId = service + PhoneGap.callbackId++;\n        if (success || fail) {\n            PhoneGap.callbacks[callbackId] = {success:success, fail:fail};\n        }\n\n        var r = prompt(PhoneGap.stringify(args), "gap:"+PhoneGap.stringify([service, action, callbackId, true]));\n\n        // If a result was returned\n        if (r.length > 0) {\n            eval("var v="+r+";");\n\n            // If status is OK, then return value back to caller\n            if (v.status === PhoneGap.callbackStatus.OK) {\n\n                // If there is a success callback, then call it now with\n                // returned value\n                if (success) {\n                    try {\n                        success(v.message);\n                    } catch (e) {\n                        console.log("Error in success callback: " + callbackId  + " = " + e);\n                    }\n\n                    // Clear callback if not expecting any more results\n                    if (!v.keepCallback) {\n                        delete PhoneGap.callbacks[callbackId];\n                    }\n                }\n                return v.message;\n            }\n\n            // If no result\n            else if (v.status === PhoneGap.callbackStatus.NO_RESULT) {\n\n                // Clear callback if not expecting any more results\n                if (!v.keepCallback) {\n                    delete PhoneGap.callbacks[callbackId];\n                }\n            }\n\n            // If error, then display error\n            else {\n                console.log("Error: Status="+v.status+" Message="+v.message);\n\n                // If there is a fail callback, then call it now with returned value\n                if (fail) {\n                    try {\n                        fail(v.message);\n                    }\n                    catch (e1) {\n                        console.log("Error in error callback: "+callbackId+" = "+e1);\n                    }\n\n                    // Clear callback if not expecting any more results\n                    if (!v.keepCallback) {\n                        delete PhoneGap.callbacks[callbackId];\n                    }\n                }\n                return null;\n            }\n        }\n    } catch (e2) {\n        console.log("Error: "+e2);\n    }\n};\n\n/**\n * Called by native code when returning successful result from an action.\n *\n * @param callbackId\n * @param args\n */\nPhoneGap.callbackSuccess = function(callbackId, args) {\n    if (PhoneGap.callbacks[callbackId]) {\n\n        // If result is to be sent to callback\n        if (args.status === PhoneGap.callbackStatus.OK) {\n            try {\n                if (PhoneGap.callbacks[callbackId].success) {\n                    PhoneGap.callbacks[callbackId].success(args.message);\n                }\n            }\n            catch (e) {\n                console.log("Error in success callback: "+callbackId+" = "+e);\n            }\n        }\n\n        // Clear callback if not expecting any more results\n        if (!args.keepCallback) {\n            delete PhoneGap.callbacks[callbackId];\n        }\n    }\n};\n\n/**\n * Called by native code when returning error result from an action.\n *\n * @param callbackId\n * @param args\n */\nPhoneGap.callbackError = function(callbackId, args) {\n    if (PhoneGap.callbacks[callbackId]) {\n        try {\n            if (PhoneGap.callbacks[callbackId].fail) {\n                PhoneGap.callbacks[callbackId].fail(args.message);\n            }\n        }\n        catch (e) {\n            console.log("Error in error callback: "+callbackId+" = "+e);\n        }\n\n        // Clear callback if not expecting any more results\n        if (!args.keepCallback) {\n            delete PhoneGap.callbacks[callbackId];\n        }\n    }\n};\n\n\n/**\n * Internal function used to dispatch the request to PhoneGap.  It processes the\n * command queue and executes the next command on the list.  If one of the\n * arguments is a JavaScript object, it will be passed on the QueryString of the\n * url, which will be turned into a dictionary on the other end.\n * @private\n */\n// TODO: Is this used?\nPhoneGap.run_command = function() {\n    if (!PhoneGap.available || !PhoneGap.queue.ready) {\n        return;\n    }\n    PhoneGap.queue.ready = false;\n\n    var args = PhoneGap.queue.commands.shift();\n    if (PhoneGap.queue.commands.length === 0) {\n        clearInterval(PhoneGap.queue.timer);\n        PhoneGap.queue.timer = null;\n    }\n\n    var uri = [];\n    var dict = null;\n    var i;\n    for (i = 1; i < args.length; i++) {\n        var arg = args[i];\n        if (arg === undefined || arg === null) {\n            arg = \'\';\n        }\n        if (typeof(arg) === \'object\') {\n            dict = arg;\n        } else {\n            uri.push(encodeURIComponent(arg));\n        }\n    }\n    var url = "gap://" + args[0] + "/" + uri.join("/");\n    if (dict !== null) {\n        var name;\n        var query_args = [];\n        for (name in dict) {\n            if (dict.hasOwnProperty(name) && (typeof (name) === \'string\')) {\n                query_args.push(encodeURIComponent(name) + "=" + encodeURIComponent(dict[name]));\n            }\n        }\n        if (query_args.length > 0) {\n            url += "?" + query_args.join("&");\n        }\n    }\n    document.location = url;\n\n};\n\nPhoneGap.JSCallbackPort = null;\nPhoneGap.JSCallbackToken = null;\n\n/**\n * This is only for Android.\n *\n * Internal function that uses XHR to call into PhoneGap Java code and retrieve\n * any JavaScript code that needs to be run.  This is used for callbacks from\n * Java to JavaScript.\n */\nPhoneGap.JSCallback = function() {\n\n    // Exit if shutting down app\n    if (PhoneGap.shuttingDown) {\n        return;\n    }\n\n    // If polling flag was changed, start using polling from now on\n    if (PhoneGap.UsePolling) {\n        PhoneGap.JSCallbackPolling();\n        return;\n    }\n\n    var xmlhttp = new XMLHttpRequest();\n\n    // Callback function when XMLHttpRequest is ready\n    xmlhttp.onreadystatechange=function(){\n        if(xmlhttp.readyState === 4){\n\n            // Exit if shutting down app\n            if (PhoneGap.shuttingDown) {\n                return;\n            }\n\n            // If callback has JavaScript statement to execute\n            if (xmlhttp.status === 200) {\n\n                // Need to url decode the response\n                var msg = decodeURIComponent(xmlhttp.responseText);\n                setTimeout(function() {\n                    try {\n                        var t = eval(msg);\n                    }\n                    catch (e) {\n                        // If we\'re getting an error here, seeing the message will help in debugging\n                        console.log("JSCallback: Message from Server: " + msg);\n                        console.log("JSCallback Error: "+e);\n                    }\n                }, 1);\n                setTimeout(PhoneGap.JSCallback, 1);\n            }\n\n            // If callback ping (used to keep XHR request from timing out)\n            else if (xmlhttp.status === 404) {\n                setTimeout(PhoneGap.JSCallback, 10);\n            }\n\n            // If security error\n            else if (xmlhttp.status === 403) {\n                console.log("JSCallback Error: Invalid token.  Stopping callbacks.");\n            }\n\n            // If server is stopping\n            else if (xmlhttp.status === 503) {\n                console.log("JSCallback Error: Service unavailable.  Stopping callbacks.");\n            }\n\n            // If request wasn\'t GET\n            else if (xmlhttp.status === 400) {\n                console.log("JSCallback Error: Bad request.  Stopping callbacks.");\n            }\n\n            // If error, revert to polling\n            else {\n                console.log("JSCallback Error: Request failed.");\n                PhoneGap.UsePolling = true;\n                PhoneGap.JSCallbackPolling();\n            }\n        }\n    };\n\n    if (PhoneGap.JSCallbackPort === null) {\n        PhoneGap.JSCallbackPort = prompt("getPort", "gap_callbackServer:");\n    }\n    if (PhoneGap.JSCallbackToken === null) {\n        PhoneGap.JSCallbackToken = prompt("getToken", "gap_callbackServer:");\n    }\n    xmlhttp.open("GET", "http://127.0.0.1:"+PhoneGap.JSCallbackPort+"/"+PhoneGap.JSCallbackToken , true);\n    xmlhttp.send();\n};\n\n/**\n * The polling period to use with JSCallbackPolling.\n * This can be changed by the application.  The default is 50ms.\n */\nPhoneGap.JSCallbackPollingPeriod = 50;\n\n/**\n * Flag that can be set by the user to force polling to be used or force XHR to be used.\n */\nPhoneGap.UsePolling = false;    // T=use polling, F=use XHR\n\n/**\n * This is only for Android.\n *\n * Internal function that uses polling to call into PhoneGap Java code and retrieve\n * any JavaScript code that needs to be run.  This is used for callbacks from\n * Java to JavaScript.\n */\nPhoneGap.JSCallbackPolling = function() {\n\n    // Exit if shutting down app\n    if (PhoneGap.shuttingDown) {\n        return;\n    }\n\n    // If polling flag was changed, stop using polling from now on\n    if (!PhoneGap.UsePolling) {\n        PhoneGap.JSCallback();\n        return;\n    }\n\n    var msg = prompt("", "gap_poll:");\n    if (msg) {\n        setTimeout(function() {\n            try {\n                var t = eval(""+msg);\n            }\n            catch (e) {\n                console.log("JSCallbackPolling: Message from Server: " + msg);\n                console.log("JSCallbackPolling Error: "+e);\n            }\n        }, 1);\n        setTimeout(PhoneGap.JSCallbackPolling, 1);\n    }\n    else {\n        setTimeout(PhoneGap.JSCallbackPolling, PhoneGap.JSCallbackPollingPeriod);\n    }\n};\n\n/**\n * Create a UUID\n *\n * @return {String}\n */\nPhoneGap.createUUID = function() {\n    return PhoneGap.UUIDcreatePart(4) + \'-\' +\n        PhoneGap.UUIDcreatePart(2) + \'-\' +\n        PhoneGap.UUIDcreatePart(2) + \'-\' +\n        PhoneGap.UUIDcreatePart(2) + \'-\' +\n        PhoneGap.UUIDcreatePart(6);\n};\n\nPhoneGap.UUIDcreatePart = function(length) {\n    var uuidpart = "";\n    var i, uuidchar;\n    for (i=0; i<length; i++) {\n        uuidchar = parseInt((Math.random() * 256),0).toString(16);\n        if (uuidchar.length === 1) {\n            uuidchar = "0" + uuidchar;\n        }\n        uuidpart += uuidchar;\n    }\n    return uuidpart;\n};\n\nPhoneGap.close = function(context, func, params) {\n    if (typeof params === \'undefined\') {\n        return function() {\n            return func.apply(context, arguments);\n        };\n    } else {\n        return function() {\n            return func.apply(context, params);\n        };\n    }\n};\n\n/**\n * Load a JavaScript file after page has loaded.\n *\n * @param {String} jsfile               The url of the JavaScript file to load.\n * @param {Function} successCallback    The callback to call when the file has been loaded.\n */\nPhoneGap.includeJavascript = function(jsfile, successCallback) {\n    var id = document.getElementsByTagName("head")[0];\n    var el = document.createElement(\'script\');\n    el.type = \'text/javascript\';\n    if (typeof successCallback === \'function\') {\n        el.onload = successCallback;\n    }\n    el.src = jsfile;\n    id.appendChild(el);\n};\n\n/**\n * This class is provided to bridge the gap between the way plugins were setup in 0.9.3 and 0.9.4.  \n * Users should be calling navigator.add.addService() instead of PluginManager.addService().\n * @class\n * @deprecated\n */\nvar PluginManager = {\n    addService: function(serviceType, className) {\n        try {\n            navigator.app.addService(serviceType, className);\n        } catch (e) {\n            console.log("Error adding service "+serviceType+": "+e);\n        }\n    }\n};\n\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("accelerometer")) {\nPhoneGap.addResource("accelerometer");\n\n/** @constructor */\nvar Acceleration = function(x, y, z) {\n  this.x = x;\n  this.y = y;\n  this.z = z;\n  this.timestamp = new Date().getTime();\n};\n\n/**\n * This class provides access to device accelerometer data.\n * @constructor\n */\nvar Accelerometer = function() {\n\n    /**\n     * The last known acceleration.  type=Acceleration()\n     */\n    this.lastAcceleration = null;\n\n    /**\n     * List of accelerometer watch timers\n     */\n    this.timers = {};\n};\n\nAccelerometer.ERROR_MSG = ["Not running", "Starting", "", "Failed to start"];\n\n/**\n * Asynchronously aquires the current acceleration.\n *\n * @param {Function} successCallback    The function to call when the acceleration data is available\n * @param {Function} errorCallback      The function to call when there is an error getting the acceleration data. (OPTIONAL)\n * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)\n */\nAccelerometer.prototype.getCurrentAcceleration = function(successCallback, errorCallback, options) {\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Accelerometer Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Accelerometer Error: errorCallback is not a function");\n        return;\n    }\n\n    // Get acceleration\n    PhoneGap.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []);\n};\n\n/**\n * Asynchronously aquires the acceleration repeatedly at a given interval.\n *\n * @param {Function} successCallback    The function to call each time the acceleration data is available\n * @param {Function} errorCallback      The function to call when there is an error getting the acceleration data. (OPTIONAL)\n * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)\n * @return String                       The watch id that must be passed to #clearWatch to stop watching.\n */\nAccelerometer.prototype.watchAcceleration = function(successCallback, errorCallback, options) {\n\n    // Default interval (10 sec)\n    var frequency = (options !== undefined)? options.frequency : 10000;\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Accelerometer Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Accelerometer Error: errorCallback is not a function");\n        return;\n    }\n\n    // Make sure accelerometer timeout > frequency + 10 sec\n    PhoneGap.exec(\n        function(timeout) {\n            if (timeout < (frequency + 10000)) {\n                PhoneGap.exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]);\n            }\n        },\n        function(e) { }, "Accelerometer", "getTimeout", []);\n\n    // Start watch timer\n    var id = PhoneGap.createUUID();\n    navigator.accelerometer.timers[id] = setInterval(function() {\n        PhoneGap.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []);\n    }, (frequency ? frequency : 1));\n\n    return id;\n};\n\n/**\n * Clears the specified accelerometer watch.\n *\n * @param {String} id       The id of the watch returned from #watchAcceleration.\n */\nAccelerometer.prototype.clearWatch = function(id) {\n\n    // Stop javascript timer & remove from timer list\n    if (id && navigator.accelerometer.timers[id] !== undefined) {\n        clearInterval(navigator.accelerometer.timers[id]);\n        delete navigator.accelerometer.timers[id];\n    }\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.accelerometer === "undefined") {\n        navigator.acce';b.b.b+='lerometer = new Accelerometer();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("app")) {\nPhoneGap.addResource("app");\n\n/**\n * Constructor\n * @constructor\n */\nvar App = function() {};\n\n/**\n * Clear the resource cache.\n */\nApp.prototype.clearCache = function() {\n    PhoneGap.exec(null, null, "App", "clearCache", []);\n};\n\n/**\n * Load the url into the webview.\n *\n * @param url           The URL to load\n * @param props         Properties that can be passed in to the activity:\n *      wait: int                           => wait msec before loading URL\n *      loadingDialog: "Title,Message"      => display a native loading dialog\n *      hideLoadingDialogOnPage: boolean    => hide loadingDialog when page loaded instead of when deviceready event occurs.\n *      loadInWebView: boolean              => cause all links on web page to be loaded into existing web view, instead of being loaded into new browser.\n *      loadUrlTimeoutValue: int            => time in msec to wait before triggering a timeout error\n *      errorUrl: URL                       => URL to load if there\'s an error loading specified URL with loadUrl().  Should be a local URL such as file:///android_asset/www/error.html");\n *      keepRunning: boolean                => enable app to keep running in background\n *\n * Example:\n *      App app = new App();\n *      app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});\n */\nApp.prototype.loadUrl = function(url, props) {\n    PhoneGap.exec(null, null, "App", "loadUrl", [url, props]);\n};\n\n/**\n * Cancel loadUrl that is waiting to be loaded.\n */\nApp.prototype.cancelLoadUrl = function() {\n    PhoneGap.exec(null, null, "App", "cancelLoadUrl", []);\n};\n\n/**\n * Clear web history in this web view.\n * Instead of BACK button loading the previous web page, it will exit the app.\n */\nApp.prototype.clearHistory = function() {\n    PhoneGap.exec(null, null, "App", "clearHistory", []);\n};\n\n/**\n * Add a class that implements a service.\n *\n * @param serviceType\n * @param className\n */\nApp.prototype.addService = function(serviceType, className) {\n\tPhoneGap.exec(null, null, "App", "addService", [serviceType, className]);\n};\n\n/**\n * Override the default behavior of the Android back button.\n * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.\n *\n * Note: The user should not have to call this method.  Instead, when the user\n *       registers for the "backbutton" event, this is automatically done.\n *\n * @param override\t\tT=override, F=cancel override\n */\nApp.prototype.overrideBackbutton = function(override) {\n    PhoneGap.exec(null, null, "App", "overrideBackbutton", [override]);\n};\n\n/**\n * Exit and terminate the application.\n */\nApp.prototype.exitApp = function() {\n\treturn PhoneGap.exec(null, null, "App", "exitApp", []);\n};\n\nPhoneGap.addConstructor(function() {\n    navigator.app = window.app = new App();\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("camera")) {\nPhoneGap.addResource("camera");\n\n/**\n * This class provides access to the device camera.\n *\n * @constructor\n */\nvar Camera = function() {\n    this.successCallback = null;\n    this.errorCallback = null;\n    this.options = null;\n};\n\n/**\n * Format of image that returned from getPicture.\n *\n * Example: navigator.camera.getPicture(success, fail,\n *              { quality: 80,\n *                destinationType: Camera.DestinationType.DATA_URL,\n *                sourceType: Camera.PictureSourceType.PHOTOLIBRARY})\n */\nCamera.DestinationType = {\n    DATA_URL: 0,                // Return base64 encoded string\n    FILE_URI: 1                 // Return file uri (content://media/external/images/media/2 for Android)\n};\nCamera.prototype.DestinationType = Camera.DestinationType;\n\n/**\n * Source to getPicture from.\n *\n * Example: navigator.camera.getPicture(success, fail,\n *              { quality: 80,\n *                destinationType: Camera.DestinationType.DATA_URL,\n *                sourceType: Camera.PictureSourceType.PHOTOLIBRARY})\n */\nCamera.PictureSourceType = {\n    PHOTOLIBRARY : 0,           // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)\n    CAMERA : 1,                 // Take picture from camera\n    SAVEDPHOTOALBUM : 2         // Choose image from picture library (same as PHOTOLIBRARY for Android)\n};\nCamera.prototype.PictureSourceType = Camera.PictureSourceType;\n\n/**\n * Gets a picture from source defined by "options.sourceType", and returns the\n * image as defined by the "options.destinationType" option.\n\n * The defaults are sourceType=CAMERA and destinationType=DATA_URL.\n *\n * @param {Function} successCallback\n * @param {Function} errorCallback\n * @param {Object} options\n */\nCamera.prototype.getPicture = function(successCallback, errorCallback, options) {\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Camera Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Camera Error: errorCallback is not a function");\n        return;\n    }\n\n    this.options = options;\n    var quality = 80;\n    if (options.quality) {\n        quality = this.options.quality;\n    }\n    var destinationType = Camera.DestinationType.DATA_URL;\n    if (this.options.destinationType) {\n        destinationType = this.options.destinationType;\n    }\n    var sourceType = Camera.PictureSourceType.CAMERA;\n    if (typeof this.options.sourceType === "number") {\n        sourceType = this.options.sourceType;\n    }\n    PhoneGap.exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType]);\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.camera === "undefined") {\n        navigator.camera = new Camera();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("capture")) {\nPhoneGap.addResource("capture");\n\t\n/**\n * Represents a single file.\n *\n * name {DOMString} name of the file, without path information\n * fullPath {DOMString} the full path of the file, including the name\n * type {DOMString} mime type\n * lastModifiedDate {Date} last modified date\n * size {Number} size of the file in bytes\n */\nvar MediaFile = function(name, fullPath, type, lastModifiedDate, size){\n\tthis.name = name || null;\n\tthis.fullPath = fullPath || null;\n\tthis.type = type || null;\n\tthis.lastModifiedDate = lastModifiedDate || null;\n\tthis.size = size || 0;\n};\n\n/**\n * Launch device camera application for recording video(s).\n *\n * @param {Function} successCB\n * @param {Function} errorCB\n */\nMediaFile.prototype.getFormatData = function(successCallback, errorCallback){\n\tPhoneGap.exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]);\n};\n\n/**\n * MediaFileData encapsulates format information of a media file.\n *\n * @param {DOMString} codecs\n * @param {long} bitrate\n * @param {long} height\n * @param {long} width\n * @param {float} duration\n */\nvar MediaFileData = function(codecs, bitrate, height, width, duration){\n\tthis.codecs = codecs || null;\n\tthis.bitrate = bitrate || 0;\n\tthis.height = height || 0;\n\tthis.width = width || 0;\n\tthis.duration = duration || 0;\n};\n\n/**\n * The CaptureError interface encapsulates all errors in the Capture API.\n */\nvar CaptureError = function(){\n\tthis.code = null;\n};\n\n// Capture error codes\nCaptureError.CAPTURE_INTERNAL_ERR = 0;\nCaptureError.CAPTURE_APPLICATION_BUSY = 1;\nCaptureError.CAPTURE_INVALID_ARGUMENT = 2;\nCaptureError.CAPTURE_NO_MEDIA_FILES = 3;\nCaptureError.CAPTURE_NOT_SUPPORTED = 20;\n\n/**\n * The Capture interface exposes an interface to the camera and microphone of the hosting device.\n */\nvar Capture = function(){\n\tthis.supportedAudioModes = [];\n\tthis.supportedImageModes = [];\n\tthis.supportedVideoModes = [];\n};\n\n/**\n * Launch audio recorder application for recording audio clip(s).\n *\n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureAudioOptions} options\n */\nCapture.prototype.captureAudio = function(successCallback, errorCallback, options){\n\tPhoneGap.exec(successCallback, errorCallback, "Capture", "captureAudio", [options]);\n};\n\n/**\n * Launch camera application for taking image(s).\n *\n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureImageOptions} options\n */\nCapture.prototype.captureImage = function(successCallback, errorCallback, options){\n\tPhoneGap.exec(successCallback, errorCallback, "Capture", "captureImage", [options]);\n};\n\n/**\n * Launch camera application for taking image(s).\n *\n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureImageOptions} options\n */\nCapture.prototype._castMediaFile = function(pluginResult){\n\tvar mediaFiles = [];\n\tvar i;\n\tfor (i = 0; i < pluginResult.message.length; i++) {\n\t\tvar mediaFile = new MediaFile();\n\t\tmediaFile.name = pluginResult.message[i].name;\n\t\tmediaFile.fullPath = pluginResult.message[i].fullPath;\n\t\tmediaFile.type = pluginResult.message[i].type;\n\t\tmediaFile.lastModifiedDate = pluginResult.message[i].lastModifiedDate;\n\t\tmediaFile.size = pluginResult.message[i].size;\n\t\tmediaFiles.push(mediaFile);\n\t}\n\tpluginResult.message = mediaFiles;\n\treturn pluginResult;\n};\n\n/**\n * Launch device camera application for recording video(s).\n *\n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureVideoOptions} options\n */\nCapture.prototype.captureVideo = function(successCallback, errorCallback, options){\n\tPhoneGap.exec(successCallback, errorCallback, "Capture", "captureVideo", [options]);\n};\n\n/**\n * Encapsulates a set of parameters that the capture device supports.\n */\nvar ConfigurationData = function(){\n\t// The ASCII-encoded string in lower case representing the media type. \n\tthis.type = null;\n\t// The height attribute represents height of the image or video in pixels. \n\t// In the case of a sound clip this attribute has value 0. \n\tthis.height = 0;\n\t// The width attribute represents width of the image or video in pixels. \n\t// In the case of a sound clip this attribute has value 0\n\tthis.width = 0;\n};\n\n/**\n * Encapsulates all image capture operation configuration options.\n */\nvar CaptureImageOptions = function(){\n\t// Upper limit of images user can take. Value must be equal or greater than 1.\n\tthis.limit = 1;\n\t// The selected image mode. Must match with one of the elements in supportedImageModes array.\n\tthis.mode = null;\n};\n\n/**\n * Encapsulates all video capture operation configuration options.\n */\nvar CaptureVideoOptions = function(){\n\t// Upper limit of videos user can record. Value must be equal or greater than 1.\n\tthis.limit = 1;\n\t// Maximum duration of a single video clip in seconds.\n\tthis.duration = 0;\n\t// The selected video mode. Must match with one of the elements in supportedVideoModes array.\n\tthis.mode = null;\n};\n\n/**\n * Encapsulates all audio capture operation configuration options.\n */\nvar CaptureAudioOptions = function(){\n\t// Upper limit of sound clips user can record. Value must be equal or greater than 1.\n\tthis.limit = 1;\n\t// Maximum duration of a single sound clip in seconds.\n\tthis.duration = 0;\n\t// The selected audio mode. Must match with one of the elements in supportedAudioModes array.\n\tthis.mode = null;\n};\n\nPhoneGap.addConstructor(function(){\n\tif (typeof navigator.device === "undefined") {\n\t\tnavigator.device = window.device = new Device();\n\t}\n\tif (typeof navigator.device.capture === "undefined") {\n\t\tnavigator.device.capture = window.device.capture = new Capture();\n\t}\n});\n}/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("compass")) {\nPhoneGap.addResource("compass");\n\n/**\n * This class provides access to device Compass data.\n * @constructor\n */\nvar Compass = function() {\n    /**\n     * The last known Compass position.\n     */\n    this.lastHeading = null;\n\n    /**\n     * List of compass watch timers\n     */\n    this.timers = {};\n};\n\nCompass.ERROR_MSG = ["Not running", "Starting", "", "Failed to start"];\n\n/**\n * Asynchronously aquires the current heading.\n *\n * @param {Function} successCallback The function to call when the heading data is available\n * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)\n * @param {PositionOptions} options The options for getting the heading data such as timeout. (OPTIONAL)\n */\nCompass.prototype.getCurrentHeading = function(successCallback, errorCallback, options) {\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Compass Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Compass Error: errorCallback is not a function");\n        return;\n    }\n\n    // Get heading\n    PhoneGap.exec(successCallback, errorCallback, "Compass", "getHeading", []);\n};\n\n/**\n * Asynchronously aquires the heading repeatedly at a given interval.\n *\n * @param {Function} successCallback    The function to call each time the heading data is available\n * @param {Function} errorCallback      The function to call when there is an error getting the heading data. (OPTIONAL)\n * @param {HeadingOptions} options      The options for getting the heading data such as timeout and the frequency of the watch. (OPTIONAL)\n * @return String                       The watch id that must be passed to #clearWatch to stop watching.\n */\nCompass.prototype.watchHeading= function(successCallback, errorCallback, options) {\n\n    // Default interval (100 msec)\n    var frequency = (options !== undefined) ? options.frequency : 100;\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Compass Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Compass Error: errorCallback is not a function");\n        return;\n    }\n\n    // Make sure compass timeout > frequency + 10 sec\n    PhoneGap.exec(\n        function(timeout) {\n            if (timeout < (frequency + 10000)) {\n                PhoneGap.exec(null, null, "Compass", "setTimeout", [frequency + 10000]);\n            }\n        },\n        function(e) { }, "Compass", "getTimeout", []);\n\n    // Start watch timer to get headings\n    var id = PhoneGap.createUUID();\n    navigator.compass.timers[id] = setInterval(\n        function() {\n            PhoneGap.exec(successCallback, errorCallback, "Compass", "getHeading", []);\n        }, (frequency ? frequency : 1));\n\n    return id;\n};\n\n\n/**\n * Clears the specified heading watch.\n *\n * @param {String} id       The ID of the watch returned from #watchHeading.\n */\nCompass.prototype.clearWatch = function(id) {\n\n    // Stop javascript timer & remove from timer list\n    if (id && navigator.compass.timers[id]) {\n        clearInterval(navigator.compass.timers[id]);\n        delete navigator.compass.timers[id];\n    }\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.compass === "undefined") {\n        navigator.compass = new Compass();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyrig';b.b.b+='ht (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("contact")) {\nPhoneGap.addResource("contact");\n\n/**\n* Contains information about a single contact.\n* @constructor\n* @param {DOMString} id unique identifier\n* @param {DOMString} displayName\n* @param {ContactName} name\n* @param {DOMString} nickname\n* @param {Array.<ContactField>} phoneNumbers array of phone numbers\n* @param {Array.<ContactField>} emails array of email addresses\n* @param {Array.<ContactAddress>} addresses array of addresses\n* @param {Array.<ContactField>} ims instant messaging user ids\n* @param {Array.<ContactOrganization>} organizations\n* @param {DOMString} revision date contact was last updated\n* @param {DOMString} birthday contact\'s birthday\n* @param {DOMString} gender contact\'s gender\n* @param {DOMString} note user notes about contact\n* @param {Array.<ContactField>} photos\n* @param {Array.<ContactField>} categories\n* @param {Array.<ContactField>} urls contact\'s web sites\n* @param {DOMString} timezone the contacts time zone\n*/\nvar Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses,\n    ims, organizations, revision, birthday, gender, note, photos, categories, urls, timezone) {\n    this.id = id || null;\n    this.rawId = null;\n    this.displayName = displayName || null;\n    this.name = name || null; // ContactName\n    this.nickname = nickname || null;\n    this.phoneNumbers = phoneNumbers || null; // ContactField[]\n    this.emails = emails || null; // ContactField[]\n    this.addresses = addresses || null; // ContactAddress[]\n    this.ims = ims || null; // ContactField[]\n    this.organizations = organizations || null; // ContactOrganization[]\n    this.revision = revision || null;\n    this.birthday = birthday || null;\n    this.gender = gender || null;\n    this.note = note || null;\n    this.photos = photos || null; // ContactField[]\n    this.categories = categories || null; // ContactField[]\n    this.urls = urls || null; // ContactField[]\n    this.timezone = timezone || null;\n};\n\n/**\n *  ContactError.\n *  An error code assigned by an implementation when an error has occurreds\n * @constructor\n */\nvar ContactError = function() {\n    this.code=null;\n};\n\n/**\n * Error codes\n */\nContactError.UNKNOWN_ERROR = 0;\nContactError.INVALID_ARGUMENT_ERROR = 1;\nContactError.NOT_FOUND_ERROR = 2;\nContactError.TIMEOUT_ERROR = 3;\nContactError.PENDING_OPERATION_ERROR = 4;\nContactError.IO_ERROR = 5;\nContactError.NOT_SUPPORTED_ERROR = 6;\nContactError.PERMISSION_DENIED_ERROR = 20;\n\n/**\n* Removes contact from device storage.\n* @param successCB success callback\n* @param errorCB error callback\n*/\nContact.prototype.remove = function(successCB, errorCB) {\n    if (this.id === null) {\n        var errorObj = new ContactError();\n        errorObj.code = ContactError.NOT_FOUND_ERROR;\n        errorCB(errorObj);\n    }\n    else {\n        PhoneGap.exec(successCB, errorCB, "Contacts", "remove", [this.id]);\n    }\n};\n\n/**\n* Creates a deep copy of this Contact.\n* With the contact ID set to null.\n* @return copy of this Contact\n*/\nContact.prototype.clone = function() {\n    var clonedContact = PhoneGap.clone(this);\n    var i;\n    clonedContact.id = null;\n    clonedContact.rawId = null;\n    // Loop through and clear out any id\'s in phones, emails, etc.\n    if (clonedContact.phoneNumbers) {\n        for (i = 0; i < clonedContact.phoneNumbers.length; i++) {\n            clonedContact.phoneNumbers[i].id = null;\n        }\n    }\n    if (clonedContact.emails) {\n        for (i = 0; i < clonedContact.emails.length; i++) {\n            clonedContact.emails[i].id = null;\n        }\n    }\n    if (clonedContact.addresses) {\n        for (i = 0; i < clonedContact.addresses.length; i++) {\n            clonedContact.addresses[i].id = null;\n        }\n    }\n    if (clonedContact.ims) {\n        for (i = 0; i < clonedContact.ims.length; i++) {\n            clonedContact.ims[i].id = null;\n        }\n    }\n    if (clonedContact.organizations) {\n        for (i = 0; i < clonedContact.organizations.length; i++) {\n            clonedContact.organizations[i].id = null;\n        }\n    }\n    if (clonedContact.tags) {\n        for (i = 0; i < clonedContact.tags.length; i++) {\n            clonedContact.tags[i].id = null;\n        }\n    }\n    if (clonedContact.photos) {\n        for (i = 0; i < clonedContact.photos.length; i++) {\n            clonedContact.photos[i].id = null;\n        }\n    }\n    if (clonedContact.urls) {\n        for (i = 0; i < clonedContact.urls.length; i++) {\n            clonedContact.urls[i].id = null;\n        }\n    }\n    return clonedContact;\n};\n\n/**\n* Persists contact to device storage.\n* @param successCB success callback\n* @param errorCB error callback\n*/\nContact.prototype.save = function(successCB, errorCB) {\n    PhoneGap.exec(successCB, errorCB, "Contacts", "save", [this]);\n};\n\n/**\n* Contact name.\n* @constructor\n* @param formatted\n* @param familyName\n* @param givenName\n* @param middle\n* @param prefix\n* @param suffix\n*/\nvar ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) {\n    this.formatted = formatted || null;\n    this.familyName = familyName || null;\n    this.givenName = givenName || null;\n    this.middleName = middle || null;\n    this.honorificPrefix = prefix || null;\n    this.honorificSuffix = suffix || null;\n};\n\n/**\n* Generic contact field.\n* @constructor\n* @param {DOMString} id unique identifier, should only be set by native code\n* @param type\n* @param value\n* @param pref\n*/\nvar ContactField = function(type, value, pref) {\n\tthis.id = null;\n    this.type = type || null;\n    this.value = value || null;\n    this.pref = pref || null;\n};\n\n/**\n* Contact address.\n* @constructor\n* @param {DOMString} id unique identifier, should only be set by native code\n* @param formatted\n* @param streetAddress\n* @param locality\n* @param region\n* @param postalCode\n* @param country\n*/\nvar ContactAddress = function(formatted, streetAddress, locality, region, postalCode, country) {\n\tthis.id = null;\n    this.formatted = formatted || null;\n    this.streetAddress = streetAddress || null;\n    this.locality = locality || null;\n    this.region = region || null;\n    this.postalCode = postalCode || null;\n    this.country = country || null;\n};\n\n/**\n* Contact organization.\n* @constructor\n* @param {DOMString} id unique identifier, should only be set by native code\n* @param name\n* @param dept\n* @param title\n* @param startDate\n* @param endDate\n* @param location\n* @param desc\n*/\nvar ContactOrganization = function(name, dept, title) {\n\tthis.id = null;\n    this.name = name || null;\n    this.department = dept || null;\n    this.title = title || null;\n};\n\n/**\n* Represents a group of Contacts.\n* @constructor\n*/\nvar Contacts = function() {\n    this.inProgress = false;\n    this.records = [];\n};\n/**\n* Returns an array of Contacts matching the search criteria.\n* @param fields that should be searched\n* @param successCB success callback\n* @param errorCB error callback\n* @param {ContactFindOptions} options that can be applied to contact searching\n* @return array of Contacts matching search criteria\n*/\nContacts.prototype.find = function(fields, successCB, errorCB, options) {\n    PhoneGap.exec(successCB, errorCB, "Contacts", "search", [fields, options]);\n};\n\n/**\n* This function creates a new contact, but it does not persist the contact\n* to device storage. To persist the contact to device storage, invoke\n* contact.save().\n* @param properties an object who\'s properties will be examined to create a new Contact\n* @returns new Contact object\n*/\nContacts.prototype.create = function(properties) {\n    var i;\n\tvar contact = new Contact();\n    for (i in properties) {\n        if (contact[i] !== \'undefined\') {\n            contact[i] = properties[i];\n        }\n    }\n    return contact;\n};\n\n/**\n* This function returns and array of contacts.  It is required as we need to convert raw\n* JSON objects into concrete Contact objects.  Currently this method is called after\n* navigator.service.contacts.find but before the find methods success call back.\n*\n* @param jsonArray an array of JSON Objects that need to be converted to Contact objects.\n* @returns an array of Contact objects\n*/\nContacts.prototype.cast = function(pluginResult) {\n\tvar contacts = [];\n\tvar i;\n\tfor (i=0; i<pluginResult.message.length; i++) {\n\t\tcontacts.push(navigator.service.contacts.create(pluginResult.message[i]));\n\t}\n\tpluginResult.message = contacts;\n\treturn pluginResult;\n};\n\n/**\n * ContactFindOptions.\n * @constructor\n * @param filter used to match contacts against\n * @param multiple boolean used to determine if more than one contact should be returned\n * @param updatedSince return only contact records that have been updated on or after the given time\n */\nvar ContactFindOptions = function(filter, multiple, updatedSince) {\n    this.filter = filter || \'\';\n    this.multiple = multiple || true;\n    this.updatedSince = updatedSince || \'\';\n};\n\n/**\n * Add the contact interface into the browser.\n */\nPhoneGap.addConstructor(function() {\n    if(typeof navigator.service === "undefined") {\n        navigator.service = {};\n    }\n    if(typeof navigator.service.contacts === "undefined") {\n        navigator.service.contacts = new Contacts();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\n// TODO: Needs to be commented\n\nif (!PhoneGap.hasResource("crypto")) {\nPhoneGap.addResource("crypto");\n\n/**\n* @constructor\n*/\nvar Crypto = function() {\n};\n\nCrypto.prototype.encrypt = function(seed, string, callback) {\n    this.encryptWin = callback;\n    PhoneGap.exec(null, null, "Crypto", "encrypt", [seed, string]);\n};\n\nCrypto.prototype.decrypt = function(seed, string, callback) {\n    this.decryptWin = callback;\n    PhoneGap.exec(null, null, "Crypto", "decrypt", [seed, string]);\n};\n\nCrypto.prototype.gotCryptedString = function(string) {\n    this.encryptWin(string);\n};\n\nCrypto.prototype.getPlainString = function(string) {\n    this.decryptWin(string);\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.Crypto === "undefined") {\n        navigator.Crypto = new Crypto();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("device")) {\nPhoneGap.addResource("device");\n\n/**\n * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the\n * phone, etc.\n * @constructor\n */\nvar Device = function() {\n    this.available = PhoneGap.available;\n    this.platform = null;\n    this.version = null;\n    this.name = null;\n    this.uuid = null;\n    this.phonegap = null;\n\n    var me = this;\n    this.getInfo(\n        function(info) {\n            me.available = true;\n            me.platform = info.platform;\n            me.version = info.version;\n            me.name = info.name;\n            me.uuid = info.uuid;\n            me.phonegap = info.phonegap;\n            PhoneGap.onPhoneGapInfoReady.fire();\n        },\n        function(e) {\n            me.available = false;\n            console.log("Error initializing PhoneGap: " + e);\n            alert("Error initializing PhoneGap: "+e);\n        });\n};\n\n/**\n * Get device info\n *\n * @param {Function} successCallback The function to call when the heading data is available\n * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)\n */\nDevice.prototype.getInfo = function(successCallback, errorCallback) {\n\n    // successCallback required\n    if (typeof successCallback !== "function") {\n        console.log("Device Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Device Error: errorCallback is not a function");\n        return;\n    }\n\n    // Get info\n    PhoneGap.exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);\n};\n\n/*\n * DEPRECATED\n * This is only for Android.\n *\n * You must explicitly override the back button.\n */\nDevice.prototype.overrideBackButton = function() {\n\tconsole.log("Device.overrideBackButton() is deprecated.  Use App.overrideBackbutton(true).");\n\tnavigator.app.overrideBackbutton(true);\n};\n\n/*\n * DEPRECATED\n * This is only for Android.\n *\n * This resets the back button to the default behaviour\n */\nDevice.prototype.resetBackButton = function() {\n\tconsole.log("Device.resetBackButton() is deprecated.  Use App.overrideBackbutton(false).");\n\tnavigator.app.overrideBackbutton(false);\n};\n\n/*\n * DEPRECATED\n * This is only for Android.\n *\n * This terminates the activity!\n */\nDevice.prototype.exitApp = function() {\n\tconsole.log("Device.exitApp() is deprecated.  Use App.exitApp().");\n\tnavigator.app.exitApp();\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.device === "undefined") {\n        navigator.device = window.device = new Device();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("file")) {\nPhoneGap.addResource("file");\n\n/**\n * This class provides some useful information about a file.\n * This is the fields returned when navigator.fileMgr.getFileProperties()\n * is called.\n * @constructor\n */\nvar FileProperties = function(filePath) {\n    this.filePath = filePath;\n    this.size = 0;\n    this.lastModifiedDate = null;\n};\n\n/**\n * Represents a single file.\n *\n * @constructor\n * @param name {DOMString} name of the file, without path information\n * @param fullPath {DOMString} the full path of the file, including the name\n * @param type {DOMString} mime type\n * @param lastModifiedDate {Date} last modified date\n * @param size {Number} size of the file in bytes\n */\nvar File = function(name, fullPath, type, lastModifiedDate, size) {\n\tthis.name = name || null;\n    this.fullPath = fullPath || null;\n\tthis.type = type || null;\n    this.lastModifiedDate = lastModifiedDate || null;\n    this.size = size || 0;\n};\n\n/** @constructor */\nvar FileError = function() {\n   this.code = null;\n};\n\n// File error codes\n// Found in DOMException\nFileError.NOT_FOUND_ERR = 1;\nFileError.SECURITY_ERR = 2;\nFileError.ABORT_ERR = 3;\n\n// Added by this specification\nFileError.NOT_READABLE_ERR = 4;\nFileError.ENCODING_ERR = 5;\nFileError.NO_MODIFICATION_ALLOWED_ERR = 6;\nFileError.INVALID_STATE_ERR = 7;\nFileError.SYNTAX_ERR = 8;\nFileError.INVALID_MODIFICATION_ERR = 9;\nFileError.QUOTA_EXCEEDED_ERR = 10;\nFileError.TYPE_MISMATCH_ERR = 11;\nFileError.PATH_EXISTS_ERR = 12;\n\n//-----------------------------------------------------------------------------\n// File manager\n//-----------------------------------------------------------------------------\n\n/** @constructor */\nvar FileMgr = function() {\n};\n\nFileMgr.prototype.getFileProperties = function(filePath) {\n    return PhoneGap.exec(null, null, "File", "getFileProperties", [filePath]);\n};\n\nFileMgr.prototype.getFileBasePaths = function() {\n};\n\nFileMgr.prototype.testSaveLocationExists = function(successCallback, errorCallback) {\n    return PhoneGap.exec(successCallback, errorCallback, "File", "testSaveLocationExists", []);\n};\n\nFileMgr.prototype.testFileExists = function(fileName, successCallback, errorCallback) {\n    return PhoneGap.exec(successCallback, errorCallback, "File", "testFileExists", [fileName]);\n};\n\nFileMgr.prototype.testDirectoryExists = function(dirName, successCallback, errorCallback) {\n    return PhoneGap.exec(successCallback, errorCallback, "File", "testDirectoryExists", [dirName]);\n};\n\nFileMgr.prototype.getFreeDiskSpace = function(successCallback, errorCallback) {\n    return PhoneGap.exec(successCallback, errorCallback, "File", "getFreeDiskSpace", []);\n};\n\nFileMgr.prototype.writeAsText = function(fileName, data, append, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "writ';b.b.b+='eAsText", [fileName, data, append]);\n};\n\nFileMgr.prototype.write = function(fileName, data, position, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "write", [fileName, data, position]);\n};\n\nFileMgr.prototype.truncate = function(fileName, size, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "truncate", [fileName, size]);\n};\n\nFileMgr.prototype.readAsText = function(fileName, encoding, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "readAsText", [fileName, encoding]);\n};\n\nFileMgr.prototype.readAsDataURL = function(fileName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "readAsDataURL", [fileName]);\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.fileMgr === "undefined") {\n        navigator.fileMgr = new FileMgr();\n    }\n});\n\n//-----------------------------------------------------------------------------\n// File Reader\n//-----------------------------------------------------------------------------\n// TODO: All other FileMgr function operate on the SD card as root.  However,\n//       for FileReader & FileWriter the root is not SD card.  Should this be changed?\n\n/**\n * This class reads the mobile device file system.\n *\n * For Android:\n *      The root directory is the root of the file system.\n *      To read from the SD card, the file name is "sdcard/my_file.txt"\n * @constructor\n */\nvar FileReader = function() {\n    this.fileName = "";\n\n    this.readyState = 0;\n\n    // File data\n    this.result = null;\n\n    // Error\n    this.error = null;\n\n    // Event handlers\n    this.onloadstart = null;    // When the read starts.\n    this.onprogress = null;     // While reading (and decoding) file or fileBlob data, and reporting partial file data (progess.loaded/progress.total)\n    this.onload = null;         // When the read has successfully completed.\n    this.onerror = null;        // When the read has failed (see errors).\n    this.onloadend = null;      // When the request has completed (either in success or failure).\n    this.onabort = null;        // When the read has been aborted. For instance, by invoking the abort() method.\n};\n\n// States\nFileReader.EMPTY = 0;\nFileReader.LOADING = 1;\nFileReader.DONE = 2;\n\n/**\n * Abort reading file.\n */\nFileReader.prototype.abort = function() {\n    var evt;\n    this.readyState = FileReader.DONE;\n    this.result = null;\n\n    // set error\n    var error = new FileError();\n    error.code = error.ABORT_ERR;\n    this.error = error;\n\n    // If error callback\n    if (typeof this.onerror === "function") {\n        this.onerror({"type":"error", "target":this});\n    }\n    // If abort callback\n    if (typeof this.onabort === "function") {\n        this.oneabort({"type":"abort", "target":this});\n    }\n    // If load end callback\n    if (typeof this.onloadend === "function") {\n        this.onloadend({"type":"loadend", "target":this});\n    }\n};\n\n/**\n * Read text file.\n *\n * @param file          {File} File object containing file properties\n * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)\n */\nFileReader.prototype.readAsText = function(file, encoding) {\n    this.fileName = "";\n\tif (typeof file.fullPath === "undefined") {\n\t\tthis.fileName = file;\n\t} else {\n\t\tthis.fileName = file.fullPath;\n\t}\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === "function") {\n        this.onloadstart({"type":"loadstart", "target":this});\n    }\n\n    // Default encoding is UTF-8\n    var enc = encoding ? encoding : "UTF-8";\n\n    var me = this;\n\n    // Read file\n    navigator.fileMgr.readAsText(this.fileName, enc,\n\n        // Success callback\n        function(r) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = r;\n\n            // If onload callback\n            if (typeof me.onload === "function") {\n                me.onload({"type":"load", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                me.onloadend({"type":"loadend", "target":me});\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save error\n\t\t    me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                me.onerror({"type":"error", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                me.onloadend({"type":"loadend", "target":me});\n            }\n        }\n        );\n};\n\n\n/**\n * Read file and return data as a base64 encoded data url.\n * A data url is of the form:\n *      data:[<mediatype>][;base64],<data>\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsDataURL = function(file) {\n\tthis.fileName = "";\n    if (typeof file.fullPath === "undefined") {\n        this.fileName = file;\n    } else {\n        this.fileName = file.fullPath;\n    }\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === "function") {\n        this.onloadstart({"type":"loadstart", "target":this});\n    }\n\n    var me = this;\n\n    // Read file\n    navigator.fileMgr.readAsDataURL(this.fileName,\n\n        // Success callback\n        function(r) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = r;\n\n            // If onload callback\n            if (typeof me.onload === "function") {\n                me.onload({"type":"load", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                me.onloadend({"type":"loadend", "target":me});\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                me.onerror({"type":"error", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                me.onloadend({"type":"loadend", "target":me});\n            }\n        }\n        );\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsBinaryString = function(file) {\n    // TODO - Can\'t return binary data to browser.\n    this.fileName = file;\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsArrayBuffer = function(file) {\n    // TODO - Can\'t return binary data to browser.\n    this.fileName = file;\n};\n\n//-----------------------------------------------------------------------------\n// File Writer\n//-----------------------------------------------------------------------------\n\n/**\n * This class writes to the mobile device file system.\n *\n * For Android:\n *      The root directory is the root of the file system.\n *      To write to the SD card, the file name is "sdcard/my_file.txt"\n *\n * @constructor\n * @param file {File} File object containing file properties\n * @param append if true write to the end of the file, otherwise overwrite the file\n */\nvar FileWriter = function(file) {\n    this.fileName = "";\n    this.length = 0;\n\tif (file) {\n\t    this.fileName = file.fullPath || file;\n\t    this.length = file.size || 0;\n\t}\n    // default is to write at the beginning of the file\n    this.position = 0;\n\n    this.readyState = 0; // EMPTY\n\n    this.result = null;\n\n    // Error\n    this.error = null;\n\n    // Event handlers\n    this.onwritestart = null;\t// When writing starts\n    this.onprogress = null;\t\t// While writing the file, and reporting partial file data\n    this.onwrite = null;\t\t// When the write has successfully completed.\n    this.onwriteend = null;\t\t// When the request has completed (either in success or failure).\n    this.onabort = null;\t\t// When the write has been aborted. For instance, by invoking the abort() method.\n    this.onerror = null;\t\t// When the write has failed (see errors).\n};\n\n// States\nFileWriter.INIT = 0;\nFileWriter.WRITING = 1;\nFileWriter.DONE = 2;\n\n/**\n * Abort writing file.\n */\nFileWriter.prototype.abort = function() {\n    // check for invalid state\n\tif (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\n    // set error\n    var error = new FileError(), evt;\n    error.code = error.ABORT_ERR;\n    this.error = error;\n\n    // If error callback\n    if (typeof this.onerror === "function") {\n        this.onerror({"type":"error", "target":this});\n    }\n    // If abort callback\n    if (typeof this.onabort === "function") {\n        this.oneabort({"type":"abort", "target":this});\n    }\n\n    this.readyState = FileWriter.DONE;\n\n    // If write end callback\n    if (typeof this.onwriteend == "function") {\n        this.onwriteend({"type":"writeend", "target":this});\n    }\n};\n\n/**\n * Writes data to the file\n *\n * @param text to be written\n */\nFileWriter.prototype.write = function(text) {\n\t// Throw an exception if we are already writing a file\n\tif (this.readyState === FileWriter.WRITING) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === "function") {\n        me.onwritestart({"type":"writestart", "target":me});\n    }\n\n    // Write file\n    navigator.fileMgr.write(this.fileName, text, this.position,\n\n        // Success callback\n        function(r) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // position always increases by bytes written because file would be extended\n            me.position += r;\n            // The length of the file is now where we are done writing.\n            me.length = me.position;\n\n            // If onwrite callback\n            if (typeof me.onwrite === "function") {\n                me.onwrite({"type":"write", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                me.onwriteend({"type":"writeend", "target":me});\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                me.onerror({"type":"error", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                me.onwriteend({"type":"writeend", "target":me});\n            }\n        }\n        );\n\n};\n\n/**\n * Moves the file pointer to the location specified.\n *\n * If the offset is a negative number the position of the file\n * pointer is rewound.  If the offset is greater than the file\n * size the position is set to the end of the file.\n *\n * @param offset is the location to move the file pointer to.\n */\nFileWriter.prototype.seek = function(offset) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw FileError.INVALID_STATE_ERR;\n    }\n\n    if (!offset) {\n        return;\n    }\n\n    // See back from end of file.\n    if (offset < 0) {\n\t\tthis.position = Math.max(offset + this.length, 0);\n\t}\n    // Offset is bigger then file size so set position\n    // to the end of the file.\n\telse if (offset > this.length) {\n\t\tthis.position = this.length;\n\t}\n    // Offset is between 0 and file size so set the position\n    // to start writing.\n\telse {\n\t\tthis.position = offset;\n\t}\n};\n\n/**\n * Truncates the file to the size specified.\n *\n * @param size to chop the file at.\n */\nFileWriter.prototype.truncate = function(size) {\n\t// Throw an exception if we are already writing a file\n\tif (this.readyState === FileWriter.WRITING) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === "function") {\n        me.onwritestart({"type":"writestart", "target":this});\n    }\n\n    // Write file\n    navigator.fileMgr.truncate(this.fileName, size,\n\n        // Success callback\n        function(r) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Update the length of the file\n            me.length = r;\n            me.position = Math.min(me.position, r);\n\n            // If onwrite callback\n            if (typeof me.onwrite === "function") {\n                me.onwrite({"type":"write", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                me.onwriteend({"type":"writeend", "target":me});\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                me.onerror({"type":"error", "target":me});\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                me.onwriteend({"type":"writeend", "target":me});\n            }\n        }\n    );\n};\n\n/**\n * Information about the state of the file or directory\n *\n * @constructor\n * {Date} modificationTime (readonly)\n */\nvar Metadata = function() {\n    this.modificationTime=null;\n};\n\n/**\n * Supplies arguments to methods that lookup or create files and directories\n *\n * @constructor\n * @param {boolean} create file or directory if it doesn\'t exist\n * @param {boolean} exclusive if true the command will fail if the file or directory exists\n */\nvar Flags = function(create, exclusive) {\n    this.create = create || false;\n    this.exclusive = exclusive || false;\n};\n\n/**\n * An interface representing a file system\n *\n * @constructor\n * {DOMString} name the unique name of the file system (readonly)\n * {DirectoryEntry} root directory of the file system (readonly)\n */\nvar FileSystem = function() {\n    this.name = null;\n    this.root = null;\n};\n\n/**\n * An interface that lists the files and directories in a directory.\n * @constructor\n */\nvar DirectoryReader = function(fullPath){\n    this.fullPath = fullPath || null;\n};\n\n/**\n * Returns a list of entries from a directory.\n *\n * @param {Function} successCallback is called with a list of entrie';b.b.b+='s\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "readEntries", [this.fullPath]);\n};\n\n/**\n * An interface representing a directory on the file system.\n *\n * @constructor\n * {boolean} isFile always false (readonly)\n * {boolean} isDirectory always true (readonly)\n * {DOMString} name of the directory, excluding the path leading to it (readonly)\n * {DOMString} fullPath the absolute full path to the directory (readonly)\n * {FileSystem} filesystem on which the directory resides (readonly)\n */\nvar DirectoryEntry = function() {\n    this.isFile = false;\n    this.isDirectory = true;\n    this.name = null;\n    this.fullPath = null;\n    this.filesystem = null;\n};\n\n/**\n * Copies a directory to a new location\n *\n * @param {DirectoryEntry} parent the directory to which to copy the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Looks up the metadata of the entry\n *\n * @param {Function} successCallback is called with a Metadata object\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getMetadata = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]);\n};\n\n/**\n * Gets the parent of the entry\n *\n * @param {Function} successCallback is called with a parent entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getParent = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]);\n};\n\n/**\n * Moves a directory to a new location\n *\n * @param {DirectoryEntry} parent the directory to which to move the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Removes the entry\n *\n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.remove = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]);\n};\n\n/**\n * Returns a URI that can be used to identify this entry.\n *\n * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.\n * @return uri\n */\nDirectoryEntry.prototype.toURI = function(mimeType) {\n    return "file://" + this.fullPath;\n};\n\n/**\n * Creates a new DirectoryReader to read entries from this directory\n */\nDirectoryEntry.prototype.createReader = function(successCallback, errorCallback) {\n    return new DirectoryReader(this.fullPath);\n};\n\n/**\n * Creates or looks up a directory\n *\n * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory\n * @param {Flags} options to create or excluively create the directory\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getDirectory", [this.fullPath, path, options]);\n};\n\n/**\n * Creates or looks up a file\n *\n * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file\n * @param {Flags} options to create or excluively create the file\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getFile", [this.fullPath, path, options]);\n};\n\n/**\n * Deletes a directory and all of it\'s contents\n *\n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "removeRecursively", [this.fullPath]);\n};\n\n/**\n * An interface representing a directory on the file system.\n *\n * @constructor\n * {boolean} isFile always true (readonly)\n * {boolean} isDirectory always false (readonly)\n * {DOMString} name of the file, excluding the path leading to it (readonly)\n * {DOMString} fullPath the absolute full path to the file (readonly)\n * {FileSystem} filesystem on which the directory resides (readonly)\n */\nvar FileEntry = function() {\n    this.isFile = true;\n    this.isDirectory = false;\n    this.name = null;\n    this.fullPath = null;\n    this.filesystem = null;\n};\n\n/**\n * Copies a file to a new location\n *\n * @param {DirectoryEntry} parent the directory to which to copy the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Looks up the metadata of the entry\n *\n * @param {Function} successCallback is called with a Metadata object\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.getMetadata = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]);\n};\n\n/**\n * Gets the parent of the entry\n *\n * @param {Function} successCallback is called with a parent entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.getParent = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]);\n};\n\n/**\n * Moves a directory to a new location\n *\n * @param {DirectoryEntry} parent the directory to which to move the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Removes the entry\n *\n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.remove = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]);\n};\n\n/**\n * Returns a URI that can be used to identify this entry.\n *\n * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.\n * @return uri\n */\nFileEntry.prototype.toURI = function(mimeType) {\n    return "file://" + this.fullPath;\n};\n\n/**\n * Creates a new FileWriter associated with the file that this FileEntry represents.\n *\n * @param {Function} successCallback is called with the new FileWriter\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.createWriter = function(successCallback, errorCallback) {\n    this.file(function(filePointer) {\n        var writer = new FileWriter(filePointer);\n    \n        if (writer.fileName === null || writer.fileName === "") {\n            if (typeof errorCallback == "function") {\n                errorCallback({\n                    "code": FileError.INVALID_STATE_ERR\n                });\n            }\n        }\n    \n        if (typeof successCallback == "function") {\n            successCallback(writer);\n        }       \n    }, errorCallback);\n};\n\n/**\n * Returns a File that represents the current state of the file that this FileEntry represents.\n *\n * @param {Function} successCallback is called with the new File object\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.file = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getFileMetadata", [this.fullPath]);\n};\n\n/** @constructor */\nvar LocalFileSystem = function() {\n};\n\n// File error codes\nLocalFileSystem.TEMPORARY = 0;\nLocalFileSystem.PERSISTENT = 1;\nLocalFileSystem.RESOURCE = 2;\nLocalFileSystem.APPLICATION = 3;\n\n/**\n * Requests a filesystem in which to store application data.\n *\n * @param {int} type of file system being requested\n * @param {Function} successCallback is called with the new FileSystem\n * @param {Function} errorCallback is called with a FileError\n */\nLocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) {\n    if (type < 0 || type > 3) {\n        if (typeof errorCallback == "function") {\n            errorCallback({\n                "code": FileError.SYNTAX_ERR\n            });\n        }\n    }\n    else {\n        PhoneGap.exec(successCallback, errorCallback, "File", "requestFileSystem", [type, size]);\n    }\n};\n\n/**\n *\n * @param {DOMString} uri referring to a local file in a filesystem\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nLocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "resolveLocalFileSystemURI", [uri]);\n};\n\n/**\n* This function returns and array of contacts.  It is required as we need to convert raw\n* JSON objects into concrete Contact objects.  Currently this method is called after\n* navigator.service.contacts.find but before the find methods success call back.\n*\n* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects.\n* @returns an entry\n*/\nLocalFileSystem.prototype._castFS = function(pluginResult) {\n    var entry = null;\n    entry = new DirectoryEntry();\n    entry.isDirectory = pluginResult.message.root.isDirectory;\n    entry.isFile = pluginResult.message.root.isFile;\n    entry.name = pluginResult.message.root.name;\n    entry.fullPath = pluginResult.message.root.fullPath;\n    pluginResult.message.root = entry;\n    return pluginResult;\n};\n\nLocalFileSystem.prototype._castEntry = function(pluginResult) {\n    var entry = null;\n    if (pluginResult.message.isDirectory) {\n        console.log("This is a dir");\n        entry = new DirectoryEntry();\n    }\n    else if (pluginResult.message.isFile) {\n        console.log("This is a file");\n        entry = new FileEntry();\n    }\n    entry.isDirectory = pluginResult.message.isDirectory;\n    entry.isFile = pluginResult.message.isFile;\n    entry.name = pluginResult.message.name;\n    entry.fullPath = pluginResult.message.fullPath;\n    pluginResult.message = entry;\n    return pluginResult;\n};\n\nLocalFileSystem.prototype._castEntries = function(pluginResult) {\n    var entries = pluginResult.message;\n    var retVal = [];\n    for (var i=0; i<entries.length; i++) {\n        retVal.push(window.localFileSystem._createEntry(entries[i]));\n    }\n    pluginResult.message = retVal;\n    return pluginResult;\n};\n\nLocalFileSystem.prototype._createEntry = function(castMe) {\n    var entry = null;\n    if (castMe.isDirectory) {\n        console.log("This is a dir");\n        entry = new DirectoryEntry();\n    }\n    else if (castMe.isFile) {\n        console.log("This is a file");\n        entry = new FileEntry();\n    }\n    entry.isDirectory = castMe.isDirectory;\n    entry.isFile = castMe.isFile;\n    entry.name = castMe.name;\n    entry.fullPath = castMe.fullPath;\n    return entry;\n};\n\nLocalFileSystem.prototype._castDate = function(pluginResult) {\n    if (pluginResult.message.modificationTime) {\n        var modTime = new Date(pluginResult.message.modificationTime);\n        pluginResult.message.modificationTime = modTime;\n    }\n    else if (pluginResult.message.lastModifiedDate) {\n        var file = new File();\n        file.size = pluginResult.message.size;\n        file.type = pluginResult.message.type;\n        file.name = pluginResult.message.name;\n        file.fullPath = pluginResult.message.fullPath;\n        file.lastModifiedDate = new Date(pluginResult.message.lastModifiedDate);\n        pluginResult.message = file;\n    }\n    return pluginResult;\n};\n\n/**\n * Add the FileSystem interface into the browser.\n */\nPhoneGap.addConstructor(function() {\n\tvar pgLocalFileSystem = new LocalFileSystem();\n\t// Needed for cast methods\n    if(typeof window.localFileSystem == "undefined") window.localFileSystem  = pgLocalFileSystem;\n    if(typeof window.requestFileSystem == "undefined") window.requestFileSystem  = pgLocalFileSystem.requestFileSystem;\n    if(typeof window.resolveLocalFileSystemURI == "undefined") window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI;\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("filetransfer")) {\nPhoneGap.addResource("filetransfer");\n\n/**\n * FileTransfer uploads a file to a remote server.\n * @constructor\n */\nvar FileTransfer = function() {};\n\n/**\n * FileUploadResult\n * @constructor\n */\nvar FileUploadResult = function() {\n    this.bytesSent = 0;\n    this.responseCode = null;\n    this.response = null;\n};\n\n/**\n * FileTransferError\n * @constructor\n */\nvar FileTransferError = function() {\n    this.code = null;\n};\n\nFileTransferError.FILE_NOT_FOUND_ERR = 1;\nFileTransferError.INVALID_URL_ERR = 2;\nFileTransferError.CONNECTION_ERR = 3;\n\n/**\n* Given an absolute file path, uploads a file on the device to a remote server\n* using a multipart HTTP request.\n* @param filePath {String}           Full path of the file on the device\n* @param server {String}             URL of the server to receive the file\n* @param successCallback (Function}  Callback to be invoked when upload has completed\n* @param errorCallback {Function}    Callback to be invoked upon error\n* @param options {FileUploadOptions} Optional parameters such as file name and mimetype\n*/\nFileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, debug) {\n\n    // check for options\n    var fileKey = null;\n    var fileName = null;\n    var mimeType = null;\n    var params = null;\n    if (options) {\n        fileKey = options.fileKey;\n        fileName = options.fileName;\n        mimeType = options.mimeType;\n        if (options.params) {\n            params = options.params;\n        }\n        else {\n            params = {};\n        }\n    }\n\n    PhoneGap.exec(successCallback, errorCallback, \'FileTransfer\', \'upload\', [filePath, server, fileKey, fileName, mimeType, params, debug]);\n};\n\n/**\n * Options to customize the HTTP request used to upload files.\n * @constructor\n * @param fileKey {String}   Name of file request parameter.\n * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.\n * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.\n * @param params {Object}    Object with key: value params to send to the server.\n */\nvar FileUploadOptions = function(fileKey, fileName, mimeType, params) {\n    this.fileKey = fileKey || null;\n    this.fileName = fileName || null;\n    this.mimeType = mimeType || null;\n    this.params = params || nul';b.b.b+='l;\n};\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("geolocation")) {\nPhoneGap.addResource("geolocation");\n\n/**\n * This class provides access to device GPS data.\n * @constructor\n */\nvar Geolocation = function() {\n\n    // The last known GPS position.\n    this.lastPosition = null;\n\n    // Geolocation listeners\n    this.listeners = {};\n};\n\n/**\n * Position error object\n *\n * @constructor\n * @param code\n * @param message\n */\nvar PositionError = function(code, message) {\n    this.code = code;\n    this.message = message;\n};\n\nPositionError.PERMISSION_DENIED = 1;\nPositionError.POSITION_UNAVAILABLE = 2;\nPositionError.TIMEOUT = 3;\n\n/**\n * Asynchronously aquires the current position.\n *\n * @param {Function} successCallback    The function to call when the position data is available\n * @param {Function} errorCallback      The function to call when there is an error getting the heading position. (OPTIONAL)\n * @param {PositionOptions} options     The options for getting the position data. (OPTIONAL)\n */\nGeolocation.prototype.getCurrentPosition = function(successCallback, errorCallback, options) {\n    if (navigator._geo.listeners.global) {\n        console.log("Geolocation Error: Still waiting for previous getCurrentPosition() request.");\n        try {\n            errorCallback(new PositionError(PositionError.TIMEOUT, "Geolocation Error: Still waiting for previous getCurrentPosition() request."));\n        } catch (e) {\n        }\n        return;\n    }\n    var maximumAge = 10000;\n    var enableHighAccuracy = false;\n    var timeout = 10000;\n    if (typeof options !== "undefined") {\n        if (typeof options.maximumAge !== "undefined") {\n            maximumAge = options.maximumAge;\n        }\n        if (typeof options.enableHighAccuracy !== "undefined") {\n            enableHighAccuracy = options.enableHighAccuracy;\n        }\n        if (typeof options.timeout !== "undefined") {\n            timeout = options.timeout;\n        }\n    }\n    navigator._geo.listeners.global = {"success" : successCallback, "fail" : errorCallback };\n    PhoneGap.exec(null, null, "Geolocation", "getCurrentLocation", [enableHighAccuracy, timeout, maximumAge]);\n};\n\n/**\n * Asynchronously watches the geolocation for changes to geolocation.  When a change occurs,\n * the successCallback is called with the new location.\n *\n * @param {Function} successCallback    The function to call each time the location data is available\n * @param {Function} errorCallback      The function to call when there is an error getting the location data. (OPTIONAL)\n * @param {PositionOptions} options     The options for getting the location data such as frequency. (OPTIONAL)\n * @return String                       The watch id that must be passed to #clearWatch to stop watching.\n */\nGeolocation.prototype.watchPosition = function(successCallback, errorCallback, options) {\n    var maximumAge = 10000;\n    var enableHighAccuracy = false;\n    var timeout = 10000;\n    if (typeof options !== "undefined") {\n        if (typeof options.frequency  !== "undefined") {\n            maximumAge = options.frequency;\n        }\n        if (typeof options.maximumAge !== "undefined") {\n            maximumAge = options.maximumAge;\n        }\n        if (typeof options.enableHighAccuracy !== "undefined") {\n            enableHighAccuracy = options.enableHighAccuracy;\n        }\n        if (typeof options.timeout !== "undefined") {\n            timeout = options.timeout;\n        }\n    }\n    var id = PhoneGap.createUUID();\n    navigator._geo.listeners[id] = {"success" : successCallback, "fail" : errorCallback };\n    PhoneGap.exec(null, null, "Geolocation", "start", [id, enableHighAccuracy, timeout, maximumAge]);\n    return id;\n};\n\n/*\n * Native callback when watch position has a new position.\n * PRIVATE METHOD\n *\n * @param {String} id\n * @param {Number} lat\n * @param {Number} lng\n * @param {Number} alt\n * @param {Number} altacc\n * @param {Number} head\n * @param {Number} vel\n * @param {Number} stamp\n */\nGeolocation.prototype.success = function(id, lat, lng, alt, altacc, head, vel, stamp) {\n    var coords = new Coordinates(lat, lng, alt, altacc, head, vel);\n    var loc = new Position(coords, stamp);\n    try {\n        if (lat === "undefined" || lng === "undefined") {\n            navigator._geo.listeners[id].fail(new PositionError(PositionError.POSITION_UNAVAILABLE, "Lat/Lng are undefined."));\n        }\n        else {\n            navigator._geo.lastPosition = loc;\n            navigator._geo.listeners[id].success(loc);\n        }\n    }\n    catch (e) {\n        console.log("Geolocation Error: Error calling success callback function.");\n    }\n\n    if (id === "global") {\n        delete navigator._geo.listeners.global;\n    }\n};\n\n/**\n * Native callback when watch position has an error.\n * PRIVATE METHOD\n *\n * @param {String} id       The ID of the watch\n * @param {Number} code     The error code\n * @param {String} msg      The error message\n */\nGeolocation.prototype.fail = function(id, code, msg) {\n    try {\n        navigator._geo.listeners[id].fail(new PositionError(code, msg));\n    }\n    catch (e) {\n        console.log("Geolocation Error: Error calling error callback function.");\n    }\n};\n\n/**\n * Clears the specified heading watch.\n *\n * @param {String} id       The ID of the watch returned from #watchPosition\n */\nGeolocation.prototype.clearWatch = function(id) {\n    PhoneGap.exec(null, null, "Geolocation", "stop", [id]);\n    delete navigator._geo.listeners[id];\n};\n\n/**\n * Force the PhoneGap geolocation to be used instead of built-in.\n */\nGeolocation.usingPhoneGap = false;\nGeolocation.usePhoneGap = function() {\n    if (Geolocation.usingPhoneGap) {\n        return;\n    }\n    Geolocation.usingPhoneGap = true;\n\n    // Set built-in geolocation methods to our own implementations\n    // (Cannot replace entire geolocation, but can replace individual methods)\n    navigator.geolocation.setLocation = navigator._geo.setLocation;\n    navigator.geolocation.getCurrentPosition = navigator._geo.getCurrentPosition;\n    navigator.geolocation.watchPosition = navigator._geo.watchPosition;\n    navigator.geolocation.clearWatch = navigator._geo.clearWatch;\n    navigator.geolocation.start = navigator._geo.start;\n    navigator.geolocation.stop = navigator._geo.stop;\n};\n\nPhoneGap.addConstructor(function() {\n    navigator._geo = new Geolocation();\n\n    // No native geolocation object for Android 1.x, so use PhoneGap geolocation\n    if (typeof navigator.geolocation === \'undefined\') {\n        navigator.geolocation = navigator._geo;\n        Geolocation.usingPhoneGap = true;\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("media")) {\nPhoneGap.addResource("media");\n\n/**\n * This class provides access to the device media, interfaces to both sound and video\n *\n * @constructor\n * @param src                   The file name or url to play\n * @param successCallback       The callback to be called when the file is done playing or recording.\n *                                  successCallback() - OPTIONAL\n * @param errorCallback         The callback to be called if there is an error.\n *                                  errorCallback(int errorCode) - OPTIONAL\n * @param statusCallback        The callback to be called when media status has changed.\n *                                  statusCallback(int statusCode) - OPTIONAL\n * @param positionCallback      The callback to be called when media position has changed.\n *                                  positionCallback(long position) - OPTIONAL\n */\nvar Media = function(src, successCallback, errorCallback, statusCallback, positionCallback) {\n\n    // successCallback optional\n    if (successCallback && (typeof successCallback !== "function")) {\n        console.log("Media Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback !== "function")) {\n        console.log("Media Error: errorCallback is not a function");\n        return;\n    }\n\n    // statusCallback optional\n    if (statusCallback && (typeof statusCallback !== "function")) {\n        console.log("Media Error: statusCallback is not a function");\n        return;\n    }\n\n    // statusCallback optional\n    if (positionCallback && (typeof positionCallback !== "function")) {\n        console.log("Media Error: positionCallback is not a function");\n        return;\n    }\n\n    this.id = PhoneGap.createUUID();\n    PhoneGap.mediaObjects[this.id] = this;\n    this.src = src;\n    this.successCallback = successCallback;\n    this.errorCallback = errorCallback;\n    this.statusCallback = statusCallback;\n    this.positionCallback = positionCallback;\n    this._duration = -1;\n    this._position = -1;\n};\n\n// Media messages\nMedia.MEDIA_STATE = 1;\nMedia.MEDIA_DURATION = 2;\nMedia.MEDIA_ERROR = 9;\n\n// Media states\nMedia.MEDIA_NONE = 0;\nMedia.MEDIA_STARTING = 1;\nMedia.MEDIA_RUNNING = 2;\nMedia.MEDIA_PAUSED = 3;\nMedia.MEDIA_STOPPED = 4;\nMedia.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"];\n\n// TODO: Will MediaError be used?\n/**\n * This class contains information about any Media errors.\n * @constructor\n */\nvar MediaError = function() {\n    this.code = null;\n    this.message = "";\n};\n\nMediaError.MEDIA_ERR_ABORTED        = 1;\nMediaError.MEDIA_ERR_NETWORK        = 2;\nMediaError.MEDIA_ERR_DECODE         = 3;\nMediaError.MEDIA_ERR_NONE_SUPPORTED = 4;\n\n/**\n * Start or resume playing audio file.\n */\nMedia.prototype.play = function() {\n    PhoneGap.exec(null, null, "Media", "startPlayingAudio", [this.id, this.src]);\n};\n\n/**\n * Stop playing audio file.\n */\nMedia.prototype.stop = function() {\n    return PhoneGap.exec(null, null, "Media", "stopPlayingAudio", [this.id]);\n};\n\n/**\n * Seek or jump to a new time in the track..\n */\nMedia.prototype.seekTo = function(milliseconds) {\n    PhoneGap.exec(null, null, "Media", "seekToAudio", [this.id, milliseconds]);\n};\n\n/**\n * Pause playing audio file.\n */\nMedia.prototype.pause = function() {\n    PhoneGap.exec(null, null, "Media", "pausePlayingAudio", [this.id]);\n};\n\n/**\n * Get duration of an audio file.\n * The duration is only set for audio that is playing, paused or stopped.\n *\n * @return      duration or -1 if not known.\n */\nMedia.prototype.getDuration = function() {\n    return this._duration;\n};\n\n/**\n * Get position of audio.\n */\nMedia.prototype.getCurrentPosition = function(success, fail) {\n    PhoneGap.exec(success, fail, "Media", "getCurrentPositionAudio", [this.id]);\n};\n\n/**\n * Start recording audio file.\n */\nMedia.prototype.startRecord = function() {\n    PhoneGap.exec(null, null, "Media", "startRecordingAudio", [this.id, this.src]);\n};\n\n/**\n * Stop recording audio file.\n */\nMedia.prototype.stopRecord = function() {\n    PhoneGap.exec(null, null, "Media", "stopRecordingAudio", [this.id]);\n};\n\n/**\n * Release the resources.\n */\nMedia.prototype.release = function() {\n    PhoneGap.exec(null, null, "Media", "release", [this.id]);\n};\n\n/**\n * List of media objects.\n * PRIVATE\n */\nPhoneGap.mediaObjects = {};\n\n/**\n * Object that receives native callbacks.\n * PRIVATE\n * @constructor\n */\nPhoneGap.Media = function() {};\n\n/**\n * Get the media object.\n * PRIVATE\n *\n * @param id            The media object id (string)\n */\nPhoneGap.Media.getMediaObject = function(id) {\n    return PhoneGap.mediaObjects[id];\n};\n\n/**\n * Audio has status update.\n * PRIVATE\n *\n * @param id            The media object id (string)\n * @param status        The status code (int)\n * @param msg           The status message (string)\n */\nPhoneGap.Media.onStatus = function(id, msg, value) {\n    var media = PhoneGap.mediaObjects[id];\n\n    // If state update\n    if (msg === Media.MEDIA_STATE) {\n        if (value === Media.MEDIA_STOPPED) {\n            if (media.successCallback) {\n                media.successCallback();\n            }\n        }\n        if (media.statusCallback) {\n            media.statusCallback(value);\n        }\n    }\n    else if (msg === Media.MEDIA_DURATION) {\n        media._duration = value;\n    }\n    else if (msg === Media.MEDIA_ERROR) {\n        if (media.errorCallback) {\n            media.errorCallback(value);\n        }\n    }\n};\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("network")) {\nPhoneGap.addResource("network");\n\n/**\n * This class contains information about any NetworkStatus.\n * @constructor\n */\nvar NetworkStatus = function() {\n    //this.code = null;\n    //this.message = "";\n};\n\nNetworkStatus.NOT_REACHABLE = 0;\nNetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK = 1;\nNetworkStatus.REACHABLE_VIA_WIFI_NETWORK = 2;\n\n/**\n * This class provides access to device Network data (reachability).\n * @constructor\n */\nvar Network = function() {\n    /**\n     * The last known Network status.\n     * { hostName: string, ipAddress: string,\n        remoteHostStatus: int(0/1/2), internetConnectionStatus: int(0/1/2), localWiFiConnectionStatus: int (0/2) }\n     */\n    this.lastReachability = null;\n};\n\n/**\n * Called by the geolocation framework when the reachability status has changed.\n * @param {Reachibility} reachability The current reachability status.\n */\n// TODO: Callback from native code not implemented for Android\nNetwork.prototype.updateReachability = function(reachability) {\n    this.lastReachability = reachability;\n};\n\n/**\n * Determine if a URI is reachable over the network.\n\n * @param {Object} uri\n * @param {Function} callback\n * @param {Object} options  (isIpAddress:boolean)\n */\nNetwork.prototype.isReachable = function(uri, callback, options) {\n    var isIpAddress = false;\n    if (options && options.isIpAddress) {\n        isIpAddress = options.isIpAddress;\n    }\n    PhoneGap.exec(callback, null, "Network Status", "isReachable", [uri, isIpAddress]);\n};\n\n/**\n * This class contains information about the current network Connection.\n * @constructor\n */\nvar Connection = function() {\n    this.type = null;\n    this._firstRun = true;\n    this._timer = null;\n    this.timeout = 500;\n\n    var me = this;\n    this.getInfo(\n        function(type) {\n            // Need to send events if we are on or offline\n            if (type == "none") {\n                // set a timer if still offline at the end of timer send the offline event\n                me._timer = setTimeout(function(){\n                    me.type = type;\n                    PhoneGap.fireEvent(\'offline\');\n                    me._timer = null;\n                    }, me.timeout);\n            } else {\n                // If there is a current offline event pending clear it\n                if (me._timer != null) {\n                    clearTimeout(me._timer);\n                    me._timer = null;\n                }\n                me.type = type;\n                PhoneGap.fireEvent(\'online\');\n            }\n            \n            // should only fire this once\n            if (me._firstRun) {\n                me._firstRun = false;\n                PhoneGap.onPhoneGapConnectionReady.fire();\n            }            \n        },\n        function(e) {\n            console.log("Error initializing Network Connection: " + e);\n        });\n};\n\nConnection.UNKNOWN = "unknown";\nConnection.ETHERNET = "ethernet";\nConnection.WIFI = "wifi";\nConnection.CELL_2G = "2g";\nConnection.CELL_3G = "3g";\nConnection.CELL_4G = "4g";\nConnection.NONE = "none";\n\n/**\n * Get connection info\n *\n * @param {Function} successCallback The function to call when the Connection data is available\n * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL)\n */\nConnection.prototype.getInfo = function(successCallback, errorCallback) {\n    // Get info\n    PhoneGap.exec(successCallback, errorCallback, "Network Status", "getConnectionInfo", []);';b.b.b+='\n};\n\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.network === "undefined") {\n        navigator.network = new Network();\n    }\n    if (typeof navigator.network.connection === "undefined") {\n        navigator.network.connection = new Connection();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("notification")) {\nPhoneGap.addResource("notification");\n\n/**\n * This class provides access to notifications on the device.\n * @constructor\n */\nvar Notification = function() {\n};\n\n/**\n * Open a native alert dialog, with a customizable title and button text.\n *\n * @param {String} message              Message to print in the body of the alert\n * @param {Function} completeCallback   The callback that is called when user clicks on a button.\n * @param {String} title                Title of the alert dialog (default: Alert)\n * @param {String} buttonLabel          Label of the close button (default: OK)\n */\nNotification.prototype.alert = function(message, completeCallback, title, buttonLabel) {\n    var _title = (title || "Alert");\n    var _buttonLabel = (buttonLabel || "OK");\n    PhoneGap.exec(completeCallback, null, "Notification", "alert", [message,_title,_buttonLabel]);\n};\n\n/**\n * Open a native confirm dialog, with a customizable title and button text.\n * The result that the user selects is returned to the result callback.\n *\n * @param {String} message              Message to print in the body of the alert\n * @param {Function} resultCallback     The callback that is called when user clicks on a button.\n * @param {String} title                Title of the alert dialog (default: Confirm)\n * @param {String} buttonLabels         Comma separated list of the labels of the buttons (default: \'OK,Cancel\')\n */\nNotification.prototype.confirm = function(message, resultCallback, title, buttonLabels) {\n    var _title = (title || "Confirm");\n    var _buttonLabels = (buttonLabels || "OK,Cancel");\n    PhoneGap.exec(resultCallback, null, "Notification", "confirm", [message,_title,_buttonLabels]);\n};\n\n/**\n * Start spinning the activity indicator on the statusbar\n */\nNotification.prototype.activityStart = function() {\n    PhoneGap.exec(null, null, "Notification", "activityStart", ["Busy","Please wait..."]);\n};\n\n/**\n * Stop spinning the activity indicator on the statusbar, if it\'s currently spinning\n */\nNotification.prototype.activityStop = function() {\n    PhoneGap.exec(null, null, "Notification", "activityStop", []);\n};\n\n/**\n * Display a progress dialog with progress bar that goes from 0 to 100.\n *\n * @param {String} title        Title of the progress dialog.\n * @param {String} message      Message to display in the dialog.\n */\nNotification.prototype.progressStart = function(title, message) {\n    PhoneGap.exec(null, null, "Notification", "progressStart", [title, message]);\n};\n\n/**\n * Set the progress dialog value.\n *\n * @param {Number} value         0-100\n */\nNotification.prototype.progressValue = function(value) {\n    PhoneGap.exec(null, null, "Notification", "progressValue", [value]);\n};\n\n/**\n * Close the progress dialog.\n */\nNotification.prototype.progressStop = function() {\n    PhoneGap.exec(null, null, "Notification", "progressStop", []);\n};\n\n/**\n * Causes the device to blink a status LED.\n *\n * @param {Integer} count       The number of blinks.\n * @param {String} colour       The colour of the light.\n */\nNotification.prototype.blink = function(count, colour) {\n    // NOT IMPLEMENTED\n};\n\n/**\n * Causes the device to vibrate.\n *\n * @param {Integer} mills       The number of milliseconds to vibrate for.\n */\nNotification.prototype.vibrate = function(mills) {\n    PhoneGap.exec(null, null, "Notification", "vibrate", [mills]);\n};\n\n/**\n * Causes the device to beep.\n * On Android, the default notification ringtone is played "count" times.\n *\n * @param {Integer} count       The number of beeps.\n */\nNotification.prototype.beep = function(count) {\n    PhoneGap.exec(null, null, "Notification", "beep", [count]);\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.notification === "undefined") {\n        navigator.notification = new Notification();\n    }\n});\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\nif (!PhoneGap.hasResource("position")) {\nPhoneGap.addResource("position");\n\n/**\n * This class contains position information.\n * @param {Object} lat\n * @param {Object} lng\n * @param {Object} acc\n * @param {Object} alt\n * @param {Object} altacc\n * @param {Object} head\n * @param {Object} vel\n * @constructor\n */\nvar Position = function(coords, timestamp) {\n\tthis.coords = coords;\n\tthis.timestamp = (timestamp !== \'undefined\') ? timestamp : new Date().getTime();\n};\n\n/** @constructor */\nvar Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {\n\t/**\n\t * The latitude of the position.\n\t */\n\tthis.latitude = lat;\n\t/**\n\t * The longitude of the position,\n\t */\n\tthis.longitude = lng;\n\t/**\n\t * The accuracy of the position.\n\t */\n\tthis.accuracy = acc;\n\t/**\n\t * The altitude of the position.\n\t */\n\tthis.altitude = alt;\n\t/**\n\t * The direction the device is moving at the position.\n\t */\n\tthis.heading = head;\n\t/**\n\t * The velocity with which the device is moving at the position.\n\t */\n\tthis.speed = vel;\n\t/**\n\t * The altitude accuracy of the position.\n\t */\n\tthis.altitudeAccuracy = (altacc !== \'undefined\') ? altacc : null;\n};\n\n/**\n * This class specifies the options for requesting position data.\n * @constructor\n */\nvar PositionOptions = function() {\n\t/**\n\t * Specifies the desired position accuracy.\n\t */\n\tthis.enableHighAccuracy = true;\n\t/**\n\t * The timeout after which if position data cannot be obtained the errorCallback\n\t * is called.\n\t */\n\tthis.timeout = 10000;\n};\n\n/**\n * This class contains information about any GSP errors.\n * @constructor\n */\nvar PositionError = function() {\n\tthis.code = null;\n\tthis.message = "";\n};\n\nPositionError.UNKNOWN_ERROR = 0;\nPositionError.PERMISSION_DENIED = 1;\nPositionError.POSITION_UNAVAILABLE = 2;\nPositionError.TIMEOUT = 3;\n}\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n */\n\n/*\n * This is purely for the Android 1.5/1.6 HTML 5 Storage\n * I was hoping that Android 2.0 would deprecate this, but given the fact that\n * most manufacturers ship with Android 1.5 and do not do OTA Updates, this is required\n */\n\nif (!PhoneGap.hasResource("storage")) {\nPhoneGap.addResource("storage");\n\n/**\n * SQL result set object\n * PRIVATE METHOD\n * @constructor\n */\nvar DroidDB_Rows = function() {\n    this.resultSet = [];    // results array\n    this.length = 0;        // number of rows\n};\n\n/**\n * Get item from SQL result set\n *\n * @param row           The row number to return\n * @return              The row object\n */\nDroidDB_Rows.prototype.item = function(row) {\n    return this.resultSet[row];\n};\n\n/**\n * SQL result set that is returned to user.\n * PRIVATE METHOD\n * @constructor\n */\nvar DroidDB_Result = function() {\n    this.rows = new DroidDB_Rows();\n};\n\n/**\n * Storage object that is called by native code when performing queries.\n * PRIVATE METHOD\n * @constructor\n */\nvar DroidDB = function() {\n    this.queryQueue = {};\n};\n\n/**\n * Callback from native code when query is complete.\n * PRIVATE METHOD\n *\n * @param id                Query id\n */\nDroidDB.prototype.completeQuery = function(id, data) {\n    var query = this.queryQueue[id];\n    if (query) {\n        try {\n            delete this.queryQueue[id];\n\n            // Get transaction\n            var tx = query.tx;\n\n            // If transaction hasn\'t failed\n            // Note: We ignore all query results if previous query\n            //       in the same transaction failed.\n            if (tx && tx.queryList[id]) {\n\n                // Save query results\n                var r = new DroidDB_Result();\n                r.rows.resultSet = data;\n                r.rows.length = data.length;\n                try {\n                    if (typeof query.successCallback === \'function\') {\n                        query.successCallback(query.tx, r);\n                    }\n                } catch (ex) {\n                    console.log("executeSql error calling user success callback: "+ex);\n                }\n\n                tx.queryComplete(id);\n            }\n        } catch (e) {\n            console.log("executeSql error: "+e);\n        }\n    }\n};\n\n/**\n * Callback from native code when query fails\n * PRIVATE METHOD\n *\n * @param reason            Error message\n * @param id                Query id\n */\nDroidDB.prototype.fail = function(reason, id) {\n    var query = this.queryQueue[id];\n    if (query) {\n        try {\n            delete this.queryQueue[id];\n\n            // Get transaction\n            var tx = query.tx;\n\n            // If transaction hasn\'t failed\n            // Note: We ignore all query results if previous query\n            //       in the same transaction failed.\n            if (tx && tx.queryList[id]) {\n                tx.queryList = {};\n\n                try {\n                    if (typeof query.errorCallback === \'function\') {\n                        query.errorCallback(query.tx, reason);\n                    }\n                } catch (ex) {\n                    console.log("executeSql error calling user error callback: "+ex);\n                }\n\n                tx.queryFailed(id, reason);\n            }\n\n        } catch (e) {\n            console.log("executeSql error: "+e);\n        }\n    }\n};\n\n/**\n * SQL query object\n * PRIVATE METHOD\n *\n * @constructor\n * @param tx                The transaction object that this query belongs to\n */\nvar DroidDB_Query = function(tx) {\n\n    // Set the id of the query\n    this.id = PhoneGap.createUUID();\n\n    // Add this query to the queue\n    droiddb.queryQueue[this.id] = this;\n\n    // Init result\n    this.resultSet = [];\n\n    // Set transaction that this query belongs to\n    this.tx = tx;\n\n    // Add this query to transaction list\n    this.tx.queryList[this.id] = this;\n\n    // Callbacks\n    this.successCallback = null;\n    this.errorCallback = null;\n\n};\n\n/**\n * Transaction object\n * PRIVATE METHOD\n * @constructor\n */\nvar DroidDB_Tx = function() {\n\n    // Set the id of the transaction\n    this.id = PhoneGap.createUUID();\n\n    // Callbacks\n    this.successCallback = null;\n    this.errorCallback = null;\n\n    // Query list\n    this.queryList = {};\n};\n\n/**\n * Mark query in transaction as complete.\n * If all queries are complete, call the user\'s transaction success callback.\n *\n * @param id                Query id\n */\nDroidDB_Tx.prototype.queryComplete = function(id) {\n    delete this.queryList[id];\n\n    // If no more outstanding queries, then fire transaction success\n    if (this.successCallback) {\n        var count = 0;\n        var i;\n        for (i in this.queryList) {\n            if (this.queryList.hasOwnProperty(i)) {\n                count++;\n            }\n        }\n        if (count === 0) {\n            try {\n                this.successCallback();\n            } catch(e) {\n                console.log("Transaction error calling user success callback: " + e);\n            }\n        }\n    }\n};\n\n/**\n * Mark query in transaction as failed.\n *\n * @param id                Query id\n * @param reason            Error message\n */\nDroidDB_Tx.prototype.queryFailed = function(id, reason) {\n\n    // The sql queries in this transaction have already been run, since\n    // we really don\'t have a real transaction implemented in native code.\n    // However, the user callbacks for the remaining sql queries in transaction\n    // will not be called.\n    this.queryList = {};\n\n    if (this.errorCallback) {\n        try {\n            this.errorCallback(reason);\n        } catch(e) {\n            console.log("Transaction error calling user error callback: " + e);\n        }\n    }\n};\n\n/**\n * Execute SQL statement\n *\n * @param sql                   SQL statement to execute\n * @param params                Statement parameters\n * @param successCallback       Success callback\n * @param errorCallback         Error callback\n */\nDroidDB_Tx.prototype.executeSql = function(sql, params, successCallback, errorCallback) {\n\n    // Init params array\n    if (typeof params === \'undefined\') {\n        params = [];\n    }\n\n    // Create query and add to queue\n    var query = new DroidDB_Query(this);\n    droiddb.queryQueue[query.id] = query;\n\n    // Save callbacks\n    query.successCallback = successCallback;\n    query.errorCallback = errorCallback;\n\n    // Call native code\n    PhoneGap.exec(null, null, "Storage", "executeSql", [sql, params, query.id]);\n};\n\nvar DatabaseShell = function() {\n};\n\n/**\n * Start a transaction.\n * Does not support rollback in event of failure.\n *\n * @param process {Function}            The transaction function\n * @param successCallback {Function}\n * @param errorCallback {Function}\n */\nDatabaseShell.prototype.transaction = function(process, errorCallback, successCallback) {\n    var tx = new DroidDB_Tx();\n    tx.successCallback = successCallback;\n    tx.errorCallback = errorCallback;\n    try {\n        process(tx);\n    } catch (e) {\n        console.log("Transaction error: "+e);\n        if (tx.errorCallback) {\n            try {\n                tx.errorCallback(e);\n            } catch (ex) {\n                console.log("Transaction error calling user error callback: "+e);\n            }\n        }\n    }\n};\n\n/**\n * Open database\n *\n * @param name              Database name\n * @param version           Database version\n * @param display_name      Database display name\n * @param size              Database size in bytes\n * @return                  Database object\n */\nvar DroidDB_openDatabase = function(name, version, display_name, size) {\n    PhoneGap.exec(null, null, "Storage", "openDatabase", [name, version, display_name, size]);\n    var db = new DatabaseShell();\n    return db;\n};\n\n/**\n * For browsers with no localStorage we emulate it with SQLite. Follows the w3c api.\n * TODO: Do similar for sessionStorage.\n */\n\n/**\n * @constructor\n */\nvar CupcakeLocalStorage = function() {\n\t\ttry {\n\n\t\t\tthis.db = openDatabase(\'localStorage\', \'1.0\', \'localStorage\', 2621440);\n\t\t\tvar storage = {};\n\t\t\tthis.length = 0;\n\t\t\tfunction setLength (length) {\n\t\t\t\tthis.length = length;\n\t\t\t\tlocalStorage.length = length;\n\t\t\t}\n\t\t\tthis.db.transaction(\n\t\t\t\tfunction (transaction) {\n\t\t\t\t    var i;\n\t\t\t\t\ttransaction.executeSql(\'CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))\');\n\t\t\t\t\ttransaction.executeSql(\'SELECT * FROM storage\', [], function(tx, result) {\n\t\t\t\t\t\tfor(var i = 0; i < result.rows.length; i++) {\n\t\t\t\t\t\t\tstorage[result.rows.item(i)[\'id\']] =  result.rows.item(i)[\'body\'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetLength(result.rows.length);\n\t\t\t\t\t\tPhoneGap.initializationComplete("cupcakeStorage");\n\t\t\t\t\t});\n\n\t\t\t\t},\n\t\t\t\tfunction (err) {\n\t\t\t\t\talert(err.message);\n\t\t\t\t}\n\t\t\t);\n\t\t\tthis.setItem = function(key, val) {\n\t\t\t\tif (typeof(storage[key])==\'undefined\') {\n\t\t\t\t\tthis.length++;\n\t\t\t\t}\n\t\t\t\tstorage[key] = val;\n\t\t\t\tthis.db.transaction(\n\t\t\t\t\tfunction (transaction) {\n\t\t\t\t\t\ttransaction.executeSql(\'CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))\');\n\t\t\t\t\t\ttransaction.executeSql(\'REPLACE INTO storage (id, body) values(?,?)\', [key,val]);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tthis.getItem = function(key) {\n\t\t\t\treturn storage[key];\n\t\t\t};\n\t\t\tthis.removeItem = function(key) {\n\t\t\t\tdelete storage[key];\n\t\t\t\tthis.length--;\n\t\t\t\tthis.db.transaction(\n\t\t\t\t\tfunction (transaction) {\n\t\t\t\t\t\ttransaction.executeSql(\'CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))\');\n\t\t\t\t\t\ttransaction.executeSql(\'DELETE FROM storage where id=?\', [key]);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tthis.clear = function() {\n\t\t\t\tstorage = {};\n\t\t\t\tthis.length = 0;\n\t\t\t\tthis.db.transaction(\n\t\t\t\t\tfunction (transaction) {\n\t\t\t\t\t\ttransaction.executeSql(\'CREATE TABLE IF NOT EXISTS storage';b.b.b+=' (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))\');\n\t\t\t\t\t\ttransaction.executeSql(\'DELETE FROM storage\', []);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tthis.key = function(index) {\n\t\t\t\tvar i = 0;\n\t\t\t\tfor (var j in storage) {\n\t\t\t\t\tif (i==index) {\n\t\t\t\t\t\treturn j;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t};\n\n\t\t} catch(e) {\n\t\t\talert("Database error "+e+".");\n\t\t    return;\n\t\t}\n};\n\nPhoneGap.addConstructor(function() {\n    var setupDroidDB = function() {\n        navigator.openDatabase = window.openDatabase = DroidDB_openDatabase;\n        window.droiddb = new DroidDB();\n    }\n    if (typeof window.openDatabase === "undefined") {\n        setupDroidDB();\n    } else {\n        window.openDatabase_orig = window.openDatabase;\n        window.openDatabase = function(name, version, desc, size){\n            // Some versions of Android will throw a SECURITY_ERR so we need \n            // to catch the exception and seutp our own DB handling.\n            var db = null;\n            try {\n                db = window.openDatabase_orig(name, version, desc, size);\n            } \n            catch (ex) {\n                db = null;\n            }\n\n            if (db == null) {\n                setupDroidDB();\n                return DroidDB_openDatabase(name, version, desc, size);\n            }\n            else {\n                return db;\n            }\n        }\n    }\n    \n    if (typeof window.localStorage === "undefined") {\n        navigator.localStorage = window.localStorage = new CupcakeLocalStorage();\n        PhoneGap.waitForInitialization("cupcakeStorage");\n    }\n});\n}\n';return b.b.b};
--></script>
<script><!--
_.cM={};_=up.prototype=tp.prototype=new v;_.gC=function vp(){return ri};_.db=function wp(){return 'android_096_min'};
--></script>
<script><!--
_.eb=function xp(){var b;b=new Nw;b.b.b+='/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *\n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010, IBM Corporation\n */\nif(typeof PhoneGap==="undefined"){if(typeof(DeviceInfo)!=="object"){var DeviceInfo={}}var PhoneGap={queue:{ready:true,commands:[],timer:null}};PhoneGap.resources={base:true};PhoneGap.hasResource=function(name){return PhoneGap.resources[name]};PhoneGap.addResource=function(name){PhoneGap.resources[name]=true};PhoneGap.Channel=function(type){this.type=type;this.handlers={};this.guid=0;this.fired=false;this.enabled=true};PhoneGap.Channel.prototype.subscribe=function(f,c,g){if(f===null){return}var func=f;if(typeof c==="object"&&typeof f==="function"){func=PhoneGap.close(c,f)}g=g||func.observer_guid||f.observer_guid||this.guid++;func.observer_guid=g;f.observer_guid=g;this.handlers[g]=func;return g};PhoneGap.Channel.prototype.subscribeOnce=function(f,c){var g=null;var _this=this;var m=function(){f.apply(c||null,arguments);_this.unsubscribe(g)};if(this.fired){if(typeof c==="object"&&typeof f==="function"){f=PhoneGap.close(c,f)}f.apply(this,this.fireArgs)}else{g=this.subscribe(m)}return g};PhoneGap.Channel.prototype.unsubscribe=function(g){if(typeof g==="function"){g=g.observer_guid}this.handlers[g]=null;delete this.handlers[g]};PhoneGap.Channel.prototype.fire=function(e){if(this.enabled){var fail=false;var item,handler,rv;for(item in this.handlers){if(this.handlers.hasOwnProperty(item)){handler=this.handlers[item];if(typeof handler==="function"){rv=(handler.apply(this,arguments)===false);fail=fail||rv}}}this.fired=true;this.fireArgs=arguments;return !fail}return true};PhoneGap.Channel.join=function(h,c){var i=c.length;var f=function(){if(!(--i)){h()}};var len=i;var j;for(j=0;j<len;j++){if(!c[j].fired){c[j].subscribeOnce(f)}else{i--}}if(!i){h()}};PhoneGap.available=DeviceInfo.uuid!==undefined;PhoneGap.addConstructor=function(func){PhoneGap.onPhoneGapInit.subscribeOnce(function(){try{func()}catch(e){console.log("Failed to run constructor: "+e)}})};if(!window.plugins){window.plugins={}}PhoneGap.addPlugin=function(name,obj){if(!window.plugins[name]){window.plugins[name]=obj}else{console.log("Error: Plugin "+name+" already exists.")}};PhoneGap.onDOMContentLoaded=new PhoneGap.Channel("onDOMContentLoaded");PhoneGap.onNativeReady=new PhoneGap.Channel("onNativeReady");PhoneGap.onPhoneGapInit=new PhoneGap.Channel("onPhoneGapInit");PhoneGap.onPhoneGapReady=new PhoneGap.Channel("onPhoneGapReady");PhoneGap.onPhoneGapInfoReady=new PhoneGap.Channel("onPhoneGapInfoReady");PhoneGap.onPhoneGapConnectionReady=new PhoneGap.Channel("onPhoneGapConnectionReady");PhoneGap.onResume=new PhoneGap.Channel("onResume");PhoneGap.onPause=new PhoneGap.Channel("onPause");PhoneGap.onDestroy=new PhoneGap.Channel("onDestroy");PhoneGap.onDestroy.subscribeOnce(function(){PhoneGap.shuttingDown=true});PhoneGap.shuttingDown=false;if(typeof _nativeReady!=="undefined"){PhoneGap.onNativeReady.fire()}PhoneGap.onDeviceReady=new PhoneGap.Channel("onDeviceReady");PhoneGap.deviceReadyChannelsArray=[PhoneGap.onPhoneGapReady,PhoneGap.onPhoneGapInfoReady,PhoneGap.onPhoneGapConnectionReady];PhoneGap.deviceReadyChannelsMap={};PhoneGap.waitForInitialization=function(feature){if(feature){var channel=new PhoneGap.Channel(feature);PhoneGap.deviceReadyChannelsMap[feature]=channel;PhoneGap.deviceReadyChannelsArray.push(channel)}};PhoneGap.initializationComplete=function(feature){var channel=PhoneGap.deviceReadyChannelsMap[feature];if(channel){channel.fire()}};PhoneGap.Channel.join(function(){setTimeout(function(){if(PhoneGap.UsePolling){PhoneGap.JSCallbackPolling()}else{var polling=prompt("usePolling","gap_callbackServer:");PhoneGap.UsePolling=polling;if(polling=="true"){PhoneGap.UsePolling=true;PhoneGap.JSCallbackPolling()}else{PhoneGap.UsePolling=false;PhoneGap.JSCallback()}}},1);PhoneGap.onPhoneGapInit.fire();PhoneGap.onPhoneGapReady.fire();PhoneGap.Channel.join(function(){navigator.notification.activityStop();PhoneGap.onDeviceReady.fire();PhoneGap.onResume.fire()},PhoneGap.deviceReadyChannelsArray)},[PhoneGap.onDOMContentLoaded,PhoneGap.onNativeReady]);document.addEventListener("DOMContentLoaded",function(){PhoneGap.onDOMContentLoaded.fire()},false);PhoneGap.m_document_addEventListener=document.addEventListener;document.addEventListener=function(evt,handler,capture){var e=evt.toLowerCase();if(e==="deviceready"){PhoneGap.onDeviceReady.subscribeOnce(handler)}else{if(e==="resume"){PhoneGap.onResume.subscribe(handler);if(PhoneGap.onDeviceReady.fired){PhoneGap.onResume.fire()}}else{if(e==="pause"){PhoneGap.onPause.subscribe(handler)}else{if(e==="backbutton"){PhoneGap.exec(null,null,"App","overrideBackbutton",[true])}PhoneGap.m_document_addEventListener.call(document,evt,handler,capture)}}}};PhoneGap.m_document_removeEventListener=document.removeEventListener;document.removeEventListener=function(evt,handler,capture){var e=evt.toLowerCase();if(e==="backbutton"){PhoneGap.exec(null,null,"App","overrideBackbutton",[false])}PhoneGap.m_document_removeEventListener.call(document,evt,handler,capture)};PhoneGap.fireEvent=function(type){var e=document.createEvent("Events");e.initEvent(type);document.dispatchEvent(e)};PhoneGap.stringify=function(args){if(typeof JSON==="undefined"){var s="[";var i,type,start,name,nameType,a;for(i=0;i<args.length;i++){if(args[i]!==null){if(i>0){s=s+","}type=typeof args[i];if((type==="number")||(type==="boolean")){s=s+args[i]}else{if(args[i] instanceof Array){s=s+"["+args[i]+"]"}else{if(args[i] instanceof Object){start=true;s=s+"{";for(name in args[i]){if(args[i][name]!==null){if(!start){s=s+","}s=s+\'"\'+name+\'":\';nameType=typeof args[i][name];if((nameType==="number")||(nameType==="boolean")){s=s+args[i][name]}else{if((typeof args[i][name])==="function"){s=s+\'""\'}else{if(args[i][name] instanceof Object){s=s+PhoneGap.stringify(args[i][name])}else{s=s+\'"\'+args[i][name]+\'"\'}}}start=false}}s=s+"}"}else{a=args[i].replace(/\\\\/g,"\\\\\\\\");a=a.replace(/"/g,\'\\\\"\');s=s+\'"\'+a+\'"\'}}}}}s=s+"]";return s}else{return JSON.stringify(args)}};PhoneGap.clone=function(obj){var i,retVal;if(!obj){return obj}if(obj instanceof Array){retVal=[];for(i=0;i<obj.length;++i){retVal.push(PhoneGap.clone(obj[i]))}return retVal}if(typeof obj==="function"){return obj}if(!(obj instanceof Object)){return obj}if(obj instanceof Date){return obj}retVal={};for(i in obj){if(!(i in retVal)||retVal[i]!==obj[i]){retVal[i]=PhoneGap.clone(obj[i])}}return retVal};PhoneGap.callbackId=0;PhoneGap.callbacks={};PhoneGap.callbackStatus={NO_RESULT:0,OK:1,CLASS_NOT_FOUND_EXCEPTION:2,ILLEGAL_ACCESS_EXCEPTION:3,INSTANTIATION_EXCEPTION:4,MALFORMED_URL_EXCEPTION:5,IO_EXCEPTION:6,INVALID_ACTION:7,JSON_EXCEPTION:8,ERROR:9};PhoneGap.exec=function(success,fail,service,action,args){try{var callbackId=service+PhoneGap.callbackId++;if(success||fail){PhoneGap.callbacks[callbackId]={success:success,fail:fail}}var r=prompt(PhoneGap.stringify(args),"gap:"+PhoneGap.stringify([service,action,callbackId,true]));if(r.length>0){eval("var v="+r+";");if(v.status===PhoneGap.callbackStatus.OK){if(success){try{success(v.message)}catch(e){console.log("Error in success callback: "+callbackId+" = "+e)}if(!v.keepCallback){delete PhoneGap.callbacks[callbackId]}}return v.message}else{if(v.status===PhoneGap.callbackStatus.NO_RESULT){if(!v.keepCallback){delete PhoneGap.callbacks[callbackId]}}else{console.log("Error: Status="+v.status+" Message="+v.message);if(fail){try{fail(v.message)}catch(e1){console.log("Error in error callback: "+callbackId+" = "+e1)}if(!v.keepCallback){delete PhoneGap.callbacks[callbackId]}}return null}}}}catch(e2){console.log("Error: "+e2)}};PhoneGap.callbackSuccess=function(callbackId,args){if(PhoneGap.callbacks[callbackId]){if(args.status===PhoneGap.callbackStatus.OK){try{if(PhoneGap.callbacks[callbackId].success){PhoneGap.callbacks[callbackId].success(args.message)}}catch(e){console.log("Error in success callback: "+callbackId+" = "+e)}}if(!args.keepCallback){delete PhoneGap.callbacks[callbackId]}}};PhoneGap.callbackError=function(callbackId,args){if(PhoneGap.callbacks[callbackId]){try{if(PhoneGap.callbacks[callbackId].fail){PhoneGap.callbacks[callbackId].fail(args.message)}}catch(e){console.log("Error in error callback: "+callbackId+" = "+e)}if(!args.keepCallback){delete PhoneGap.callbacks[callbackId]}}};PhoneGap.run_command=function(){if(!PhoneGap.available||!PhoneGap.queue.ready){return}PhoneGap.queue.ready=false;var args=PhoneGap.queue.commands.shift();if(PhoneGap.queue.commands.length===0){clearInterval(PhoneGap.queue.timer);PhoneGap.queue.timer=null}var uri=[];var dict=null;var i;for(i=1;i<args.length;i++){var arg=args[i];if(arg===undefined||arg===null){arg=""}if(typeof(arg)==="object"){dict=arg}else{uri.push(encodeURIComponent(arg))}}var url="gap://"+args[0]+"/"+uri.join("/");if(dict!==null){var name;var query_args=[];for(name in dict){if(dict.hasOwnProperty(name)&&(typeof(name)==="string")){query_args.push(encodeURIComponent(name)+"="+encodeURIComponent(dict[name]))}}if(query_args.length>0){url+="?"+query_args.join("&")}}document.location=url};PhoneGap.JSCallbackPort=null;PhoneGap.JSCallbackToken=null;PhoneGap.JSCallback=function(){if(PhoneGap.shuttingDown){return}if(PhoneGap.UsePolling){PhoneGap.JSCallbackPolling();return}var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState===4){if(PhoneGap.shuttingDown){return}if(xmlhttp.status===200){var msg=decodeURIComponent(xmlhttp.responseText);setTimeout(function(){try{var t=eval(msg)}catch(e){console.log("JSCallback: Message from Server: "+msg);console.log("JSCallback Error: "+e)}},1);setTimeout(PhoneGap.JSCallback,1)}else{if(xmlhttp.status===404){setTimeout(PhoneGap.JSCallback,10)}else{if(xmlhttp.status===403){console.log("JSCallback Error: Invalid token.  Stopping callbacks.")}else{if(xmlhttp.status===503){console.log("JSCallback Error: Service unavailable.  Stopping callbacks.")}else{if(xmlhttp.status===400){console.log("JSCallback Error: Bad request.  Stopping callbacks.")}else{console.log("JSCallback Error: Request failed.");PhoneGap.UsePolling=true;PhoneGap.JSCallbackPolling()}}}}}}};if(PhoneGap.JSCallbackPort===null){PhoneGap.JSCallbackPort=prompt("getPort","gap_callbackServer:")}if(PhoneGap.JSCallbackToken===null){PhoneGap.JSCallbackToken=prompt("getToken","gap_callbackServer:")}xmlhttp.open("GET","http://127.0.0.1:"+PhoneGap.JSCallbackPort+"/"+PhoneGap.JSCallbackToken,true);xmlhttp.send()};PhoneGap.JSCallbackPollingPeriod=50;PhoneGap.UsePolling=false;PhoneGap.JSCallbackPolling=function(){if(PhoneGap.shuttingDown){return}if(!PhoneGap.UsePolling){PhoneGap.JSCallback();return}var msg=prompt("","gap_poll:");if(msg){setTimeout(function(){try{var t=eval(""+msg)}catch(e){console.log("JSCallbackPolling: Message from Server: "+msg);console.log("JSCallbackPolling Error: "+e)}},1);setTimeout(PhoneGap.JSCallbackPolling,1)}else{setTimeout(PhoneGap.JSCallbackPolling,PhoneGap.JSCallbackPollingPeriod)}};PhoneGap.createUUID=function(){return PhoneGap.UUIDcreatePart(4)+"-"+PhoneGap.UUIDcreatePart(2)+"-"+PhoneGap.UUIDcreatePart(2)+"-"+PhoneGap.UUIDcreatePart(2)+"-"+PhoneGap.UUIDcreatePart(6)};PhoneGap.UUIDcreatePart=function(length){var uuidpart="";var i,uuidchar;for(i=0;i<length;i++){uuidchar=parseInt((Math.random()*256),0).toString(16);if(uuidchar.length===1){uuidchar="0"+uuidchar}uuidpart+=uuidchar}return uuidpart};PhoneGap.close=function(context,func,params){if(typeof params==="undefined"){return function(){return func.apply(context,arguments)}}else{return function(){return func.apply(context,params)}}};PhoneGap.includeJavascript=function(jsfile,successCallback){var id=document.getElementsByTagName("head")[0];var el=document.createElement("script");el.type="text/javascript";if(typeof successCallback==="function"){el.onload=successCallback}el.src=jsfile;id.appendChild(el)};var PluginManager={addService:function(serviceType,className){try{navigator.app.addService(serviceType,className)}catch(e){console.log("Error adding service "+serviceType+": "+e)}}}}if(!PhoneGap.hasResource("accelerometer")){PhoneGap.addResource("accelerometer");var Acceleration=function(x,y,z){this.x=x;this.y=y;this.z=z;this.timestamp=new Date().getTime()};var Accelerometer=function(){this.lastAcceleration=null;this.timers={}};Accelerometer.ERROR_MSG=["Not running","Starting","","Failed to start"];Accelerometer.prototype.getCurrentAcceleration=function(successCallback,errorCallback,options){if(typeof successCallback!=="function"){console.log("Accelerometer Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Accelerometer Error: errorCallback is not a function");return}PhoneGap.exec(successCallback,errorCallback,"Accelerometer","getAcceleration",[])};Accelerometer.prototype.watchAcceleration=function(successCallback,errorCallback,options){var frequency=(options!==undefined)?options.frequency:10000;if(typeof successCallback!=="function"){console.log("Accelerometer Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Accelerometer Error: errorCallback is not a function");return}PhoneGap.exec(function(timeout){if(timeout<(frequency+10000)){PhoneGap.exec(null,null,"Accelerometer","setTimeout",[frequency+10000])}},function(e){},"Accelerometer","getTimeout",[]);var id=PhoneGap.createUUID();navigator.accelerometer.timers[id]=setInterval(function(){PhoneGap.exec(successCallback,errorCallback,"Accelerometer","getAcceleration",[])},(frequency?frequency:1));return id};Accelerometer.prototype.clearWatch=function(id){if(id&&navigator.accelerometer.timers[id]!==undefined){clearInterval(navigator.accelerometer.timers[id]);delete navigator.accelerometer.timers[id]}};PhoneGap.addConstructor(function(){if(typeof navigator.accelerometer==="undefined"){navigator.accelerometer=new Accelerometer()}})}if(!PhoneGap.hasResource("app")){PhoneGap.addResource("app");var App=function(){};App.prototype.clearCache=function(){PhoneGap.exec(null,null,"App","clearCache",[])};App.prototype.loadUrl=function(url,props){PhoneGap.exec(null,null,"App","loadUrl",[url,props])};App.prototype.cancelLoadUrl=function(){PhoneGap.exec(null,null,"App","cancelLoadUrl",[])};App.prototype.clearHistory=function(){PhoneGap.exec(null,null,"App","clearHistory",[])};App.prototype.addService=function(serviceType,className){PhoneGap.exec(null,null,"App","addService",[serviceType,className])};App.prototype.overrideBackbutton=function(override){PhoneGap.exec(null,null,"App","overrideBackbutton",[override])};App.prototype.exitApp=function(){return PhoneGap.exec(null,null,"App","exitApp",[])};PhoneGap.addConstructor(function(){navigator.app=window.app=new App()})}if(!PhoneGap.hasResource("camera")){PhoneGap.addResource("camera");var Camera=function(){this.successCallback=null;this.errorCallback=null;this.options=null};Camera.DestinationType={DATA_URL:0,FILE_URI:1};Camera.prototype.DestinationType=Camera.DestinationType;Camera.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2};Camera.prototype.PictureSourceType=Camera.PictureSourceType;Camera.prototype.getPicture=function(successCallback,errorCallback,options){if(typeof successCallback!=="function"){console.log("Camera Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Camera Error: errorCallback is not a function");return}this.options=options;var quality=80;if(options.quality){quality=this.options.quality}var destinationType=Camera.DestinationType.DATA_URL;if(this.options.destinationType){destinationType=this.options.destinationType}var sourceType=Camera.PictureSourceType.CAMERA;if(typeof this.options.sourceType==="number"){sourceType=this.options.sourceType}PhoneGap.exec(successCallback,errorCallback,"Camera","takePicture",[quality,destinationType,sourceType])};PhoneGap.addConstructor(function(){if(typeof navigator.camera==="undefined"){navigator.camera=new Camera()}})}if(!PhoneGap.hasResource("capture")){PhoneGap.addResource("capture");var MediaFile=function(name,fullPath,type,lastModifiedDate,size){this.name=name||null;this.fullPath=fullPath||null;this.type=type||null;this.lastModifiedDate=lastModifiedDate||null;this.size=size||0};MediaFile.prototype.getFormatData=fun';b.b.b+='ction(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"Capture","getFormatData",[this.fullPath,this.type])};var MediaFileData=function(codecs,bitrate,height,width,duration){this.codecs=codecs||null;this.bitrate=bitrate||0;this.height=height||0;this.width=width||0;this.duration=duration||0};var CaptureError=function(){this.code=null};CaptureError.CAPTURE_INTERNAL_ERR=0;CaptureError.CAPTURE_APPLICATION_BUSY=1;CaptureError.CAPTURE_INVALID_ARGUMENT=2;CaptureError.CAPTURE_NO_MEDIA_FILES=3;CaptureError.CAPTURE_NOT_SUPPORTED=20;var Capture=function(){this.supportedAudioModes=[];this.supportedImageModes=[];this.supportedVideoModes=[]};Capture.prototype.captureAudio=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureAudio",[options])};Capture.prototype.captureImage=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureImage",[options])};Capture.prototype._castMediaFile=function(pluginResult){var mediaFiles=[];var i;for(i=0;i<pluginResult.message.length;i++){var mediaFile=new MediaFile();mediaFile.name=pluginResult.message[i].name;mediaFile.fullPath=pluginResult.message[i].fullPath;mediaFile.type=pluginResult.message[i].type;mediaFile.lastModifiedDate=pluginResult.message[i].lastModifiedDate;mediaFile.size=pluginResult.message[i].size;mediaFiles.push(mediaFile)}pluginResult.message=mediaFiles;return pluginResult};Capture.prototype.captureVideo=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureVideo",[options])};var ConfigurationData=function(){this.type=null;this.height=0;this.width=0};var CaptureImageOptions=function(){this.limit=1;this.mode=null};var CaptureVideoOptions=function(){this.limit=1;this.duration=0;this.mode=null};var CaptureAudioOptions=function(){this.limit=1;this.duration=0;this.mode=null};PhoneGap.addConstructor(function(){if(typeof navigator.device==="undefined"){navigator.device=window.device=new Device()}if(typeof navigator.device.capture==="undefined"){navigator.device.capture=window.device.capture=new Capture()}})}if(!PhoneGap.hasResource("compass")){PhoneGap.addResource("compass");var Compass=function(){this.lastHeading=null;this.timers={}};Compass.ERROR_MSG=["Not running","Starting","","Failed to start"];Compass.prototype.getCurrentHeading=function(successCallback,errorCallback,options){if(typeof successCallback!=="function"){console.log("Compass Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Compass Error: errorCallback is not a function");return}PhoneGap.exec(successCallback,errorCallback,"Compass","getHeading",[])};Compass.prototype.watchHeading=function(successCallback,errorCallback,options){var frequency=(options!==undefined)?options.frequency:100;if(typeof successCallback!=="function"){console.log("Compass Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Compass Error: errorCallback is not a function");return}PhoneGap.exec(function(timeout){if(timeout<(frequency+10000)){PhoneGap.exec(null,null,"Compass","setTimeout",[frequency+10000])}},function(e){},"Compass","getTimeout",[]);var id=PhoneGap.createUUID();navigator.compass.timers[id]=setInterval(function(){PhoneGap.exec(successCallback,errorCallback,"Compass","getHeading",[])},(frequency?frequency:1));return id};Compass.prototype.clearWatch=function(id){if(id&&navigator.compass.timers[id]){clearInterval(navigator.compass.timers[id]);delete navigator.compass.timers[id]}};PhoneGap.addConstructor(function(){if(typeof navigator.compass==="undefined"){navigator.compass=new Compass()}})}if(!PhoneGap.hasResource("contact")){PhoneGap.addResource("contact");var Contact=function(id,displayName,name,nickname,phoneNumbers,emails,addresses,ims,organizations,revision,birthday,gender,note,photos,categories,urls,timezone){this.id=id||null;this.rawId=null;this.displayName=displayName||null;this.name=name||null;this.nickname=nickname||null;this.phoneNumbers=phoneNumbers||null;this.emails=emails||null;this.addresses=addresses||null;this.ims=ims||null;this.organizations=organizations||null;this.revision=revision||null;this.birthday=birthday||null;this.gender=gender||null;this.note=note||null;this.photos=photos||null;this.categories=categories||null;this.urls=urls||null;this.timezone=timezone||null};var ContactError=function(){this.code=null};ContactError.UNKNOWN_ERROR=0;ContactError.INVALID_ARGUMENT_ERROR=1;ContactError.NOT_FOUND_ERROR=2;ContactError.TIMEOUT_ERROR=3;ContactError.PENDING_OPERATION_ERROR=4;ContactError.IO_ERROR=5;ContactError.NOT_SUPPORTED_ERROR=6;ContactError.PERMISSION_DENIED_ERROR=20;Contact.prototype.remove=function(successCB,errorCB){if(this.id===null){var errorObj=new ContactError();errorObj.code=ContactError.NOT_FOUND_ERROR;errorCB(errorObj)}else{PhoneGap.exec(successCB,errorCB,"Contacts","remove",[this.id])}};Contact.prototype.clone=function(){var clonedContact=PhoneGap.clone(this);var i;clonedContact.id=null;clonedContact.rawId=null;if(clonedContact.phoneNumbers){for(i=0;i<clonedContact.phoneNumbers.length;i++){clonedContact.phoneNumbers[i].id=null}}if(clonedContact.emails){for(i=0;i<clonedContact.emails.length;i++){clonedContact.emails[i].id=null}}if(clonedContact.addresses){for(i=0;i<clonedContact.addresses.length;i++){clonedContact.addresses[i].id=null}}if(clonedContact.ims){for(i=0;i<clonedContact.ims.length;i++){clonedContact.ims[i].id=null}}if(clonedContact.organizations){for(i=0;i<clonedContact.organizations.length;i++){clonedContact.organizations[i].id=null}}if(clonedContact.tags){for(i=0;i<clonedContact.tags.length;i++){clonedContact.tags[i].id=null}}if(clonedContact.photos){for(i=0;i<clonedContact.photos.length;i++){clonedContact.photos[i].id=null}}if(clonedContact.urls){for(i=0;i<clonedContact.urls.length;i++){clonedContact.urls[i].id=null}}return clonedContact};Contact.prototype.save=function(successCB,errorCB){PhoneGap.exec(successCB,errorCB,"Contacts","save",[this])};var ContactName=function(formatted,familyName,givenName,middle,prefix,suffix){this.formatted=formatted||null;this.familyName=familyName||null;this.givenName=givenName||null;this.middleName=middle||null;this.honorificPrefix=prefix||null;this.honorificSuffix=suffix||null};var ContactField=function(type,value,pref){this.id=null;this.type=type||null;this.value=value||null;this.pref=pref||null};var ContactAddress=function(formatted,streetAddress,locality,region,postalCode,country){this.id=null;this.formatted=formatted||null;this.streetAddress=streetAddress||null;this.locality=locality||null;this.region=region||null;this.postalCode=postalCode||null;this.country=country||null};var ContactOrganization=function(name,dept,title){this.id=null;this.name=name||null;this.department=dept||null;this.title=title||null};var Contacts=function(){this.inProgress=false;this.records=[]};Contacts.prototype.find=function(fields,successCB,errorCB,options){PhoneGap.exec(successCB,errorCB,"Contacts","search",[fields,options])};Contacts.prototype.create=function(properties){var i;var contact=new Contact();for(i in properties){if(contact[i]!=="undefined"){contact[i]=properties[i]}}return contact};Contacts.prototype.cast=function(pluginResult){var contacts=[];var i;for(i=0;i<pluginResult.message.length;i++){contacts.push(navigator.service.contacts.create(pluginResult.message[i]))}pluginResult.message=contacts;return pluginResult};var ContactFindOptions=function(filter,multiple,updatedSince){this.filter=filter||"";this.multiple=multiple||true;this.updatedSince=updatedSince||""};PhoneGap.addConstructor(function(){if(typeof navigator.service==="undefined"){navigator.service={}}if(typeof navigator.service.contacts==="undefined"){navigator.service.contacts=new Contacts()}})}if(!PhoneGap.hasResource("crypto")){PhoneGap.addResource("crypto");var Crypto=function(){};Crypto.prototype.encrypt=function(seed,string,callback){this.encryptWin=callback;PhoneGap.exec(null,null,"Crypto","encrypt",[seed,string])};Crypto.prototype.decrypt=function(seed,string,callback){this.decryptWin=callback;PhoneGap.exec(null,null,"Crypto","decrypt",[seed,string])};Crypto.prototype.gotCryptedString=function(string){this.encryptWin(string)};Crypto.prototype.getPlainString=function(string){this.decryptWin(string)};PhoneGap.addConstructor(function(){if(typeof navigator.Crypto==="undefined"){navigator.Crypto=new Crypto()}})}if(!PhoneGap.hasResource("device")){PhoneGap.addResource("device");var Device=function(){this.available=PhoneGap.available;this.platform=null;this.version=null;this.name=null;this.uuid=null;this.phonegap=null;var me=this;this.getInfo(function(info){me.available=true;me.platform=info.platform;me.version=info.version;me.name=info.name;me.uuid=info.uuid;me.phonegap=info.phonegap;PhoneGap.onPhoneGapInfoReady.fire()},function(e){me.available=false;console.log("Error initializing PhoneGap: "+e);alert("Error initializing PhoneGap: "+e)})};Device.prototype.getInfo=function(successCallback,errorCallback){if(typeof successCallback!=="function"){console.log("Device Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Device Error: errorCallback is not a function");return}PhoneGap.exec(successCallback,errorCallback,"Device","getDeviceInfo",[])};Device.prototype.overrideBackButton=function(){console.log("Device.overrideBackButton() is deprecated.  Use App.overrideBackbutton(true).");navigator.app.overrideBackbutton(true)};Device.prototype.resetBackButton=function(){console.log("Device.resetBackButton() is deprecated.  Use App.overrideBackbutton(false).");navigator.app.overrideBackbutton(false)};Device.prototype.exitApp=function(){console.log("Device.exitApp() is deprecated.  Use App.exitApp().");navigator.app.exitApp()};PhoneGap.addConstructor(function(){if(typeof navigator.device==="undefined"){navigator.device=window.device=new Device()}})}if(!PhoneGap.hasResource("file")){PhoneGap.addResource("file");var FileProperties=function(filePath){this.filePath=filePath;this.size=0;this.lastModifiedDate=null};var File=function(name,fullPath,type,lastModifiedDate,size){this.name=name||null;this.fullPath=fullPath||null;this.type=type||null;this.lastModifiedDate=lastModifiedDate||null;this.size=size||0};var FileError=function(){this.code=null};FileError.NOT_FOUND_ERR=1;FileError.SECURITY_ERR=2;FileError.ABORT_ERR=3;FileError.NOT_READABLE_ERR=4;FileError.ENCODING_ERR=5;FileError.NO_MODIFICATION_ALLOWED_ERR=6;FileError.INVALID_STATE_ERR=7;FileError.SYNTAX_ERR=8;FileError.INVALID_MODIFICATION_ERR=9;FileError.QUOTA_EXCEEDED_ERR=10;FileError.TYPE_MISMATCH_ERR=11;FileError.PATH_EXISTS_ERR=12;var FileMgr=function(){};FileMgr.prototype.getFileProperties=function(filePath){return PhoneGap.exec(null,null,"File","getFileProperties",[filePath])};FileMgr.prototype.getFileBasePaths=function(){};FileMgr.prototype.testSaveLocationExists=function(successCallback,errorCallback){return PhoneGap.exec(successCallback,errorCallback,"File","testSaveLocationExists",[])};FileMgr.prototype.testFileExists=function(fileName,successCallback,errorCallback){return PhoneGap.exec(successCallback,errorCallback,"File","testFileExists",[fileName])};FileMgr.prototype.testDirectoryExists=function(dirName,successCallback,errorCallback){return PhoneGap.exec(successCallback,errorCallback,"File","testDirectoryExists",[dirName])};FileMgr.prototype.getFreeDiskSpace=function(successCallback,errorCallback){return PhoneGap.exec(successCallback,errorCallback,"File","getFreeDiskSpace",[])};FileMgr.prototype.writeAsText=function(fileName,data,append,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","writeAsText",[fileName,data,append])};FileMgr.prototype.write=function(fileName,data,position,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","write",[fileName,data,position])};FileMgr.prototype.truncate=function(fileName,size,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","truncate",[fileName,size])};FileMgr.prototype.readAsText=function(fileName,encoding,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readAsText",[fileName,encoding])};FileMgr.prototype.readAsDataURL=function(fileName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readAsDataURL",[fileName])};PhoneGap.addConstructor(function(){if(typeof navigator.fileMgr==="undefined"){navigator.fileMgr=new FileMgr()}});var FileReader=function(){this.fileName="";this.readyState=0;this.result=null;this.error=null;this.onloadstart=null;this.onprogress=null;this.onload=null;this.onerror=null;this.onloadend=null;this.onabort=null};FileReader.EMPTY=0;FileReader.LOADING=1;FileReader.DONE=2;FileReader.prototype.abort=function(){var evt;this.readyState=FileReader.DONE;this.result=null;var error=new FileError();error.code=error.ABORT_ERR;this.error=error;if(typeof this.onerror==="function"){this.onerror({type:"error",target:this})}if(typeof this.onabort==="function"){this.oneabort({type:"abort",target:this})}if(typeof this.onloadend==="function"){this.onloadend({type:"loadend",target:this})}};FileReader.prototype.readAsText=function(file,encoding){this.fileName="";if(typeof file.fullPath==="undefined"){this.fileName=file}else{this.fileName=file.fullPath}this.readyState=FileReader.LOADING;if(typeof this.onloadstart==="function"){this.onloadstart({type:"loadstart",target:this})}var enc=encoding?encoding:"UTF-8";var me=this;navigator.fileMgr.readAsText(this.fileName,enc,function(r){var evt;if(me.readyState===FileReader.DONE){return}me.result=r;if(typeof me.onload==="function"){me.onload({type:"load",target:me})}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){me.onloadend({type:"loadend",target:me})}},function(e){var evt;if(me.readyState===FileReader.DONE){return}me.error=e;if(typeof me.onerror==="function"){me.onerror({type:"error",target:me})}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){me.onloadend({type:"loadend",target:me})}})};FileReader.prototype.readAsDataURL=function(file){this.fileName="";if(typeof file.fullPath==="undefined"){this.fileName=file}else{this.fileName=file.fullPath}this.readyState=FileReader.LOADING;if(typeof this.onloadstart==="function"){this.onloadstart({type:"loadstart",target:this})}var me=this;navigator.fileMgr.readAsDataURL(this.fileName,function(r){var evt;if(me.readyState===FileReader.DONE){return}me.result=r;if(typeof me.onload==="function"){me.onload({type:"load",target:me})}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){me.onloadend({type:"loadend",target:me})}},function(e){var evt;if(me.readyState===FileReader.DONE){return}me.error=e;if(typeof me.onerror==="function"){me.onerror({type:"error",target:me})}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){me.onloadend({type:"loadend",target:me})}})};FileReader.prototype.readAsBinaryString=function(file){this.fileName=file};FileReader.prototype.readAsArrayBuffer=function(file){this.fileName=file};var FileWriter=function(file){this.fileName="";this.length=0;if(file){this.fileName=file.fullPath||file;this.length=file.size||0}this.position=0;this.readyState=0;this.result=null;this.error=null;this.onwritestart=null;this.onprogress=null;this.onwrite=null;this.onwriteend=null;this.onabort=null;this.onerror=null};FileWriter.INIT=0;FileWriter.WRITING=1;FileWriter.DONE=2;FileWriter.prototype.abort=function(){if(this.readyState===FileWriter.DONE||this.readyState===FileWriter.INIT){throw FileError.INVALID_STATE_ERR}var error=new FileError(),evt;error.code=error.ABORT_ERR;this.error=error;if(typeof this.onerror==="function"){this.onerror({type:"error",target:this})}if(typeof this.onabort==="function"){this.oneabort({type:"abort",target:this})}this.readyState=FileWriter.DONE;if(typeof this.onwriteend=="function"){this.onwriteend({type:"writeend",target:this})}};FileWriter.prototype.write=function(text){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}this.readyState=FileWriter.WRITING;var me=this;if(typeof me.onwritestart==="function"){me.onwritestart({type:"writestart",target:me})}navigator.fileMgr.write(this.fileName,text,this.position,function(r){var evt;if(me.';b.b.b+='readyState===FileWriter.DONE){return}me.position+=r;me.length=me.position;if(typeof me.onwrite==="function"){me.onwrite({type:"write",target:me})}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){me.onwriteend({type:"writeend",target:me})}},function(e){var evt;if(me.readyState===FileWriter.DONE){return}me.error=e;if(typeof me.onerror==="function"){me.onerror({type:"error",target:me})}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){me.onwriteend({type:"writeend",target:me})}})};FileWriter.prototype.seek=function(offset){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}if(!offset){return}if(offset<0){this.position=Math.max(offset+this.length,0)}else{if(offset>this.length){this.position=this.length}else{this.position=offset}}};FileWriter.prototype.truncate=function(size){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}this.readyState=FileWriter.WRITING;var me=this;if(typeof me.onwritestart==="function"){me.onwritestart({type:"writestart",target:this})}navigator.fileMgr.truncate(this.fileName,size,function(r){var evt;if(me.readyState===FileWriter.DONE){return}me.length=r;me.position=Math.min(me.position,r);if(typeof me.onwrite==="function"){me.onwrite({type:"write",target:me})}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){me.onwriteend({type:"writeend",target:me})}},function(e){var evt;if(me.readyState===FileWriter.DONE){return}me.error=e;if(typeof me.onerror==="function"){me.onerror({type:"error",target:me})}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){me.onwriteend({type:"writeend",target:me})}})};var Metadata=function(){this.modificationTime=null};var Flags=function(create,exclusive){this.create=create||false;this.exclusive=exclusive||false};var FileSystem=function(){this.name=null;this.root=null};var DirectoryReader=function(fullPath){this.fullPath=fullPath||null};DirectoryReader.prototype.readEntries=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readEntries",[this.fullPath])};var DirectoryEntry=function(){this.isFile=false;this.isDirectory=true;this.name=null;this.fullPath=null;this.filesystem=null};DirectoryEntry.prototype.copyTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","copyTo",[this.fullPath,parent,newName])};DirectoryEntry.prototype.getMetadata=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getMetadata",[this.fullPath])};DirectoryEntry.prototype.getParent=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getParent",[this.fullPath])};DirectoryEntry.prototype.moveTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","moveTo",[this.fullPath,parent,newName])};DirectoryEntry.prototype.remove=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","remove",[this.fullPath])};DirectoryEntry.prototype.toURI=function(mimeType){return"file://"+this.fullPath};DirectoryEntry.prototype.createReader=function(successCallback,errorCallback){return new DirectoryReader(this.fullPath)};DirectoryEntry.prototype.getDirectory=function(path,options,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getDirectory",[this.fullPath,path,options])};DirectoryEntry.prototype.getFile=function(path,options,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getFile",[this.fullPath,path,options])};DirectoryEntry.prototype.removeRecursively=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","removeRecursively",[this.fullPath])};var FileEntry=function(){this.isFile=true;this.isDirectory=false;this.name=null;this.fullPath=null;this.filesystem=null};FileEntry.prototype.copyTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","copyTo",[this.fullPath,parent,newName])};FileEntry.prototype.getMetadata=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getMetadata",[this.fullPath])};FileEntry.prototype.getParent=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getParent",[this.fullPath])};FileEntry.prototype.moveTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","moveTo",[this.fullPath,parent,newName])};FileEntry.prototype.remove=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","remove",[this.fullPath])};FileEntry.prototype.toURI=function(mimeType){return"file://"+this.fullPath};FileEntry.prototype.createWriter=function(successCallback,errorCallback){this.file(function(filePointer){var writer=new FileWriter(filePointer);if(writer.fileName===null||writer.fileName===""){if(typeof errorCallback=="function"){errorCallback({code:FileError.INVALID_STATE_ERR})}}if(typeof successCallback=="function"){successCallback(writer)}},errorCallback)};FileEntry.prototype.file=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getFileMetadata",[this.fullPath])};var LocalFileSystem=function(){};LocalFileSystem.TEMPORARY=0;LocalFileSystem.PERSISTENT=1;LocalFileSystem.RESOURCE=2;LocalFileSystem.APPLICATION=3;LocalFileSystem.prototype.requestFileSystem=function(type,size,successCallback,errorCallback){if(type<0||type>3){if(typeof errorCallback=="function"){errorCallback({code:FileError.SYNTAX_ERR})}}else{PhoneGap.exec(successCallback,errorCallback,"File","requestFileSystem",[type,size])}};LocalFileSystem.prototype.resolveLocalFileSystemURI=function(uri,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","resolveLocalFileSystemURI",[uri])};LocalFileSystem.prototype._castFS=function(pluginResult){var entry=null;entry=new DirectoryEntry();entry.isDirectory=pluginResult.message.root.isDirectory;entry.isFile=pluginResult.message.root.isFile;entry.name=pluginResult.message.root.name;entry.fullPath=pluginResult.message.root.fullPath;pluginResult.message.root=entry;return pluginResult};LocalFileSystem.prototype._castEntry=function(pluginResult){var entry=null;if(pluginResult.message.isDirectory){console.log("This is a dir");entry=new DirectoryEntry()}else{if(pluginResult.message.isFile){console.log("This is a file");entry=new FileEntry()}}entry.isDirectory=pluginResult.message.isDirectory;entry.isFile=pluginResult.message.isFile;entry.name=pluginResult.message.name;entry.fullPath=pluginResult.message.fullPath;pluginResult.message=entry;return pluginResult};LocalFileSystem.prototype._castEntries=function(pluginResult){var entries=pluginResult.message;var retVal=[];for(var i=0;i<entries.length;i++){retVal.push(window.localFileSystem._createEntry(entries[i]))}pluginResult.message=retVal;return pluginResult};LocalFileSystem.prototype._createEntry=function(castMe){var entry=null;if(castMe.isDirectory){console.log("This is a dir");entry=new DirectoryEntry()}else{if(castMe.isFile){console.log("This is a file");entry=new FileEntry()}}entry.isDirectory=castMe.isDirectory;entry.isFile=castMe.isFile;entry.name=castMe.name;entry.fullPath=castMe.fullPath;return entry};LocalFileSystem.prototype._castDate=function(pluginResult){if(pluginResult.message.modificationTime){var modTime=new Date(pluginResult.message.modificationTime);pluginResult.message.modificationTime=modTime}else{if(pluginResult.message.lastModifiedDate){var file=new File();file.size=pluginResult.message.size;file.type=pluginResult.message.type;file.name=pluginResult.message.name;file.fullPath=pluginResult.message.fullPath;file.lastModifiedDate=new Date(pluginResult.message.lastModifiedDate);pluginResult.message=file}}return pluginResult};PhoneGap.addConstructor(function(){var pgLocalFileSystem=new LocalFileSystem();if(typeof window.localFileSystem=="undefined"){window.localFileSystem=pgLocalFileSystem}if(typeof window.requestFileSystem=="undefined"){window.requestFileSystem=pgLocalFileSystem.requestFileSystem}if(typeof window.resolveLocalFileSystemURI=="undefined"){window.resolveLocalFileSystemURI=pgLocalFileSystem.resolveLocalFileSystemURI}})}if(!PhoneGap.hasResource("filetransfer")){PhoneGap.addResource("filetransfer");var FileTransfer=function(){};var FileUploadResult=function(){this.bytesSent=0;this.responseCode=null;this.response=null};var FileTransferError=function(){this.code=null};FileTransferError.FILE_NOT_FOUND_ERR=1;FileTransferError.INVALID_URL_ERR=2;FileTransferError.CONNECTION_ERR=3;FileTransfer.prototype.upload=function(filePath,server,successCallback,errorCallback,options,debug){var fileKey=null;var fileName=null;var mimeType=null;var params=null;if(options){fileKey=options.fileKey;fileName=options.fileName;mimeType=options.mimeType;if(options.params){params=options.params}else{params={}}}PhoneGap.exec(successCallback,errorCallback,"FileTransfer","upload",[filePath,server,fileKey,fileName,mimeType,params,debug])};var FileUploadOptions=function(fileKey,fileName,mimeType,params){this.fileKey=fileKey||null;this.fileName=fileName||null;this.mimeType=mimeType||null;this.params=params||null}}if(!PhoneGap.hasResource("geolocation")){PhoneGap.addResource("geolocation");var Geolocation=function(){this.lastPosition=null;this.listeners={}};var PositionError=function(code,message){this.code=code;this.message=message};PositionError.PERMISSION_DENIED=1;PositionError.POSITION_UNAVAILABLE=2;PositionError.TIMEOUT=3;Geolocation.prototype.getCurrentPosition=function(successCallback,errorCallback,options){if(navigator._geo.listeners.global){console.log("Geolocation Error: Still waiting for previous getCurrentPosition() request.");try{errorCallback(new PositionError(PositionError.TIMEOUT,"Geolocation Error: Still waiting for previous getCurrentPosition() request."))}catch(e){}return}var maximumAge=10000;var enableHighAccuracy=false;var timeout=10000;if(typeof options!=="undefined"){if(typeof options.maximumAge!=="undefined"){maximumAge=options.maximumAge}if(typeof options.enableHighAccuracy!=="undefined"){enableHighAccuracy=options.enableHighAccuracy}if(typeof options.timeout!=="undefined"){timeout=options.timeout}}navigator._geo.listeners.global={success:successCallback,fail:errorCallback};PhoneGap.exec(null,null,"Geolocation","getCurrentLocation",[enableHighAccuracy,timeout,maximumAge])};Geolocation.prototype.watchPosition=function(successCallback,errorCallback,options){var maximumAge=10000;var enableHighAccuracy=false;var timeout=10000;if(typeof options!=="undefined"){if(typeof options.frequency!=="undefined"){maximumAge=options.frequency}if(typeof options.maximumAge!=="undefined"){maximumAge=options.maximumAge}if(typeof options.enableHighAccuracy!=="undefined"){enableHighAccuracy=options.enableHighAccuracy}if(typeof options.timeout!=="undefined"){timeout=options.timeout}}var id=PhoneGap.createUUID();navigator._geo.listeners[id]={success:successCallback,fail:errorCallback};PhoneGap.exec(null,null,"Geolocation","start",[id,enableHighAccuracy,timeout,maximumAge]);return id};Geolocation.prototype.success=function(id,lat,lng,alt,altacc,head,vel,stamp){var coords=new Coordinates(lat,lng,alt,altacc,head,vel);var loc=new Position(coords,stamp);try{if(lat==="undefined"||lng==="undefined"){navigator._geo.listeners[id].fail(new PositionError(PositionError.POSITION_UNAVAILABLE,"Lat/Lng are undefined."))}else{navigator._geo.lastPosition=loc;navigator._geo.listeners[id].success(loc)}}catch(e){console.log("Geolocation Error: Error calling success callback function.")}if(id==="global"){delete navigator._geo.listeners.global}};Geolocation.prototype.fail=function(id,code,msg){try{navigator._geo.listeners[id].fail(new PositionError(code,msg))}catch(e){console.log("Geolocation Error: Error calling error callback function.")}};Geolocation.prototype.clearWatch=function(id){PhoneGap.exec(null,null,"Geolocation","stop",[id]);delete navigator._geo.listeners[id]};Geolocation.usingPhoneGap=false;Geolocation.usePhoneGap=function(){if(Geolocation.usingPhoneGap){return}Geolocation.usingPhoneGap=true;navigator.geolocation.setLocation=navigator._geo.setLocation;navigator.geolocation.getCurrentPosition=navigator._geo.getCurrentPosition;navigator.geolocation.watchPosition=navigator._geo.watchPosition;navigator.geolocation.clearWatch=navigator._geo.clearWatch;navigator.geolocation.start=navigator._geo.start;navigator.geolocation.stop=navigator._geo.stop};PhoneGap.addConstructor(function(){navigator._geo=new Geolocation();if(typeof navigator.geolocation==="undefined"){navigator.geolocation=navigator._geo;Geolocation.usingPhoneGap=true}})}if(!PhoneGap.hasResource("media")){PhoneGap.addResource("media");var Media=function(src,successCallback,errorCallback,statusCallback,positionCallback){if(successCallback&&(typeof successCallback!=="function")){console.log("Media Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!=="function")){console.log("Media Error: errorCallback is not a function");return}if(statusCallback&&(typeof statusCallback!=="function")){console.log("Media Error: statusCallback is not a function");return}if(positionCallback&&(typeof positionCallback!=="function")){console.log("Media Error: positionCallback is not a function");return}this.id=PhoneGap.createUUID();PhoneGap.mediaObjects[this.id]=this;this.src=src;this.successCallback=successCallback;this.errorCallback=errorCallback;this.statusCallback=statusCallback;this.positionCallback=positionCallback;this._duration=-1;this._position=-1};Media.MEDIA_STATE=1;Media.MEDIA_DURATION=2;Media.MEDIA_ERROR=9;Media.MEDIA_NONE=0;Media.MEDIA_STARTING=1;Media.MEDIA_RUNNING=2;Media.MEDIA_PAUSED=3;Media.MEDIA_STOPPED=4;Media.MEDIA_MSG=["None","Starting","Running","Paused","Stopped"];var MediaError=function(){this.code=null;this.message=""};MediaError.MEDIA_ERR_ABORTED=1;MediaError.MEDIA_ERR_NETWORK=2;MediaError.MEDIA_ERR_DECODE=3;MediaError.MEDIA_ERR_NONE_SUPPORTED=4;Media.prototype.play=function(){PhoneGap.exec(null,null,"Media","startPlayingAudio",[this.id,this.src])};Media.prototype.stop=function(){return PhoneGap.exec(null,null,"Media","stopPlayingAudio",[this.id])};Media.prototype.seekTo=function(milliseconds){PhoneGap.exec(null,null,"Media","seekToAudio",[this.id,milliseconds])};Media.prototype.pause=function(){PhoneGap.exec(null,null,"Media","pausePlayingAudio",[this.id])};Media.prototype.getDuration=function(){return this._duration};Media.prototype.getCurrentPosition=function(success,fail){PhoneGap.exec(success,fail,"Media","getCurrentPositionAudio",[this.id])};Media.prototype.startRecord=function(){PhoneGap.exec(null,null,"Media","startRecordingAudio",[this.id,this.src])};Media.prototype.stopRecord=function(){PhoneGap.exec(null,null,"Media","stopRecordingAudio",[this.id])};Media.prototype.release=function(){PhoneGap.exec(null,null,"Media","release",[this.id])};PhoneGap.mediaObjects={};PhoneGap.Media=function(){};PhoneGap.Media.getMediaObject=function(id){return PhoneGap.mediaObjects[id]};PhoneGap.Media.onStatus=function(id,msg,value){var media=PhoneGap.mediaObjects[id];if(msg===Media.MEDIA_STATE){if(value===Media.MEDIA_STOPPED){if(media.successCallback){media.successCallback()}}if(media.statusCallback){media.statusCallback(value)}}else{if(msg===Media.MEDIA_DURATION){media._duration=value}else{if(msg===Media.MEDIA_ERROR){if(media.errorCallback){media.errorCallback(value)}}}}}}if(!PhoneGap.hasResource("network")){PhoneGap.addResource("network");var NetworkStatus=function(){};NetworkStatus.NOT_REACHABLE=0;NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK=1;NetworkStatus.REACHABLE_VIA_WIFI_NETWORK=2;var Network=function(){this.lastReachability=null};Network.prototype.updateReachability=function(reachability){this.lastReachability=reachability};Network.prototype.isReachable=function(uri,callback,options){var isIpAddress=false;if(options&&options.isIpAddress){isIpAddress=options.isIpAddress}PhoneGap.exec(callback,null,"Network Status","isReachable",[uri,isIpAddress])};var Connection=function(){this.type=null;this._firstRun=true;this._timer=null;this.timeout=500;var me=this;this.getInfo(function(type){if(type=="none"){me._timer=setTimeout(function(){me.type=type;PhoneGap.fireEvent("offline");me._timer=null},me.tim';b.b.b+='eout)}else{if(me._timer!=null){clearTimeout(me._timer);me._timer=null}me.type=type;PhoneGap.fireEvent("online")}if(me._firstRun){me._firstRun=false;PhoneGap.onPhoneGapConnectionReady.fire()}},function(e){console.log("Error initializing Network Connection: "+e)})};Connection.UNKNOWN="unknown";Connection.ETHERNET="ethernet";Connection.WIFI="wifi";Connection.CELL_2G="2g";Connection.CELL_3G="3g";Connection.CELL_4G="4g";Connection.NONE="none";Connection.prototype.getInfo=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"Network Status","getConnectionInfo",[])};PhoneGap.addConstructor(function(){if(typeof navigator.network==="undefined"){navigator.network=new Network()}if(typeof navigator.network.connection==="undefined"){navigator.network.connection=new Connection()}})}if(!PhoneGap.hasResource("notification")){PhoneGap.addResource("notification");var Notification=function(){};Notification.prototype.alert=function(message,completeCallback,title,buttonLabel){var _title=(title||"Alert");var _buttonLabel=(buttonLabel||"OK");PhoneGap.exec(completeCallback,null,"Notification","alert",[message,_title,_buttonLabel])};Notification.prototype.confirm=function(message,resultCallback,title,buttonLabels){var _title=(title||"Confirm");var _buttonLabels=(buttonLabels||"OK,Cancel");PhoneGap.exec(resultCallback,null,"Notification","confirm",[message,_title,_buttonLabels])};Notification.prototype.activityStart=function(){PhoneGap.exec(null,null,"Notification","activityStart",["Busy","Please wait..."])};Notification.prototype.activityStop=function(){PhoneGap.exec(null,null,"Notification","activityStop",[])};Notification.prototype.progressStart=function(title,message){PhoneGap.exec(null,null,"Notification","progressStart",[title,message])};Notification.prototype.progressValue=function(value){PhoneGap.exec(null,null,"Notification","progressValue",[value])};Notification.prototype.progressStop=function(){PhoneGap.exec(null,null,"Notification","progressStop",[])};Notification.prototype.blink=function(count,colour){};Notification.prototype.vibrate=function(mills){PhoneGap.exec(null,null,"Notification","vibrate",[mills])};Notification.prototype.beep=function(count){PhoneGap.exec(null,null,"Notification","beep",[count])};PhoneGap.addConstructor(function(){if(typeof navigator.notification==="undefined"){navigator.notification=new Notification()}})}if(!PhoneGap.hasResource("position")){PhoneGap.addResource("position");var Position=function(coords,timestamp){this.coords=coords;this.timestamp=(timestamp!=="undefined")?timestamp:new Date().getTime()};var Coordinates=function(lat,lng,alt,acc,head,vel,altacc){this.latitude=lat;this.longitude=lng;this.accuracy=acc;this.altitude=alt;this.heading=head;this.speed=vel;this.altitudeAccuracy=(altacc!=="undefined")?altacc:null};var PositionOptions=function(){this.enableHighAccuracy=true;this.timeout=10000};var PositionError=function(){this.code=null;this.message=""};PositionError.UNKNOWN_ERROR=0;PositionError.PERMISSION_DENIED=1;PositionError.POSITION_UNAVAILABLE=2;PositionError.TIMEOUT=3}if(!PhoneGap.hasResource("storage")){PhoneGap.addResource("storage");var DroidDB_Rows=function(){this.resultSet=[];this.length=0};DroidDB_Rows.prototype.item=function(row){return this.resultSet[row]};var DroidDB_Result=function(){this.rows=new DroidDB_Rows()};var DroidDB=function(){this.queryQueue={}};DroidDB.prototype.completeQuery=function(id,data){var query=this.queryQueue[id];if(query){try{delete this.queryQueue[id];var tx=query.tx;if(tx&&tx.queryList[id]){var r=new DroidDB_Result();r.rows.resultSet=data;r.rows.length=data.length;try{if(typeof query.successCallback==="function"){query.successCallback(query.tx,r)}}catch(ex){console.log("executeSql error calling user success callback: "+ex)}tx.queryComplete(id)}}catch(e){console.log("executeSql error: "+e)}}};DroidDB.prototype.fail=function(reason,id){var query=this.queryQueue[id];if(query){try{delete this.queryQueue[id];var tx=query.tx;if(tx&&tx.queryList[id]){tx.queryList={};try{if(typeof query.errorCallback==="function"){query.errorCallback(query.tx,reason)}}catch(ex){console.log("executeSql error calling user error callback: "+ex)}tx.queryFailed(id,reason)}}catch(e){console.log("executeSql error: "+e)}}};var DroidDB_Query=function(tx){this.id=PhoneGap.createUUID();droiddb.queryQueue[this.id]=this;this.resultSet=[];this.tx=tx;this.tx.queryList[this.id]=this;this.successCallback=null;this.errorCallback=null};var DroidDB_Tx=function(){this.id=PhoneGap.createUUID();this.successCallback=null;this.errorCallback=null;this.queryList={}};DroidDB_Tx.prototype.queryComplete=function(id){delete this.queryList[id];if(this.successCallback){var count=0;var i;for(i in this.queryList){if(this.queryList.hasOwnProperty(i)){count++}}if(count===0){try{this.successCallback()}catch(e){console.log("Transaction error calling user success callback: "+e)}}}};DroidDB_Tx.prototype.queryFailed=function(id,reason){this.queryList={};if(this.errorCallback){try{this.errorCallback(reason)}catch(e){console.log("Transaction error calling user error callback: "+e)}}};DroidDB_Tx.prototype.executeSql=function(sql,params,successCallback,errorCallback){if(typeof params==="undefined"){params=[]}var query=new DroidDB_Query(this);droiddb.queryQueue[query.id]=query;query.successCallback=successCallback;query.errorCallback=errorCallback;PhoneGap.exec(null,null,"Storage","executeSql",[sql,params,query.id])};var DatabaseShell=function(){};DatabaseShell.prototype.transaction=function(process,errorCallback,successCallback){var tx=new DroidDB_Tx();tx.successCallback=successCallback;tx.errorCallback=errorCallback;try{process(tx)}catch(e){console.log("Transaction error: "+e);if(tx.errorCallback){try{tx.errorCallback(e)}catch(ex){console.log("Transaction error calling user error callback: "+e)}}}};var DroidDB_openDatabase=function(name,version,display_name,size){PhoneGap.exec(null,null,"Storage","openDatabase",[name,version,display_name,size]);var db=new DatabaseShell();return db};var CupcakeLocalStorage=function(){try{this.db=openDatabase("localStorage","1.0","localStorage",2621440);var storage={};this.length=0;function setLength(length){this.length=length;localStorage.length=length}this.db.transaction(function(transaction){var i;transaction.executeSql("CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))");transaction.executeSql("SELECT * FROM storage",[],function(tx,result){for(var i=0;i<result.rows.length;i++){storage[result.rows.item(i)["id"]]=result.rows.item(i)["body"]}setLength(result.rows.length);PhoneGap.initializationComplete("cupcakeStorage")})},function(err){alert(err.message)});this.setItem=function(key,val){if(typeof(storage[key])=="undefined"){this.length++}storage[key]=val;this.db.transaction(function(transaction){transaction.executeSql("CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))");transaction.executeSql("REPLACE INTO storage (id, body) values(?,?)",[key,val])})};this.getItem=function(key){return storage[key]};this.removeItem=function(key){delete storage[key];this.length--;this.db.transaction(function(transaction){transaction.executeSql("CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))");transaction.executeSql("DELETE FROM storage where id=?",[key])})};this.clear=function(){storage={};this.length=0;this.db.transaction(function(transaction){transaction.executeSql("CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))");transaction.executeSql("DELETE FROM storage",[])})};this.key=function(index){var i=0;for(var j in storage){if(i==index){return j}else{i++}}return null}}catch(e){alert("Database error "+e+".");return}};PhoneGap.addConstructor(function(){var setupDroidDB=function(){navigator.openDatabase=window.openDatabase=DroidDB_openDatabase;window.droiddb=new DroidDB()};if(typeof window.openDatabase==="undefined"){setupDroidDB()}else{window.openDatabase_orig=window.openDatabase;window.openDatabase=function(name,version,desc,size){var db=null;try{db=window.openDatabase_orig(name,version,desc,size)}catch(ex){db=null}if(db==null){setupDroidDB();return DroidDB_openDatabase(name,version,desc,size)}else{return db}}}if(typeof window.localStorage==="undefined"){navigator.localStorage=window.localStorage=new CupcakeLocalStorage();PhoneGap.waitForInitialization("cupcakeStorage")}})};';return b.b.b};
--></script>
<script><!--
_.cM={};_=zp.prototype=yp.prototype=new v;_.gC=function Ap(){return si};_.db=function Bp(){return 'ios_096'};
--></script>
<script><!--
_.eb=function Cp(){var b;b=new Nw;b.b.b+='/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n * \n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010-2011, IBM Corporation\n * Copyright (c) 2011, Codevise Solutions Ltd.\n * Copyright (c) 2011, Proyectos Equis Ka, S.L.\n * \n */\n\n/* Helper code to resolve anonymous callback functions,\n\nIf the function callback can be resolved by name it is returned unaltered.\nIf the function is defined in an unknown scope and can\'t be resolved, an internal reference to the function is added to the internal map.\n\nCallbacks added to the map are one time use only, they will be deleted once called.  \n\nexample 1:\n\nfunction myCallback(){};\n\nfString = GetFunctionName(myCallback);\n\n- result, the function is defined in the global scope, and will be returned as is because it can be resolved by name.\n\nexample 2:\n\nfString = GetFunctionName(function(){};);\n\n- result, the function is defined in place, so it will be returned unchanged.\n\nexample 3:\n\nfunction myMethod()\n{\n    var funk = function(){};\n    fString = GetFunctionName(funk);\n}\n\n- result, the function CANNOT be resolved by name, so an internal reference wrapper is created and returned.\n\n\n*/\n\n\nvar _anomFunkMap = {};\nvar _anomFunkMapNextId = 0; \n\nfunction anomToNameFunk(fun)\n{\n\tvar funkId = "f" + _anomFunkMapNextId++;\n\tvar funk = function()\n\t{\n\t\tfun.apply(this,arguments);\n\t\t_anomFunkMap[funkId] = null;\n\t\tdelete _anomFunkMap[funkId];\t\n\t}\n\t_anomFunkMap[funkId] = funk;\n\n\treturn "_anomFunkMap." + funkId;\n}\n\nfunction GetFunctionName(fn)\n{\n  if (typeof fn === "function") {\n    var name= fn.name;\t\n\tif (!name) {\n      var m = fn.toString().match(/^\\s*function\\s+([^\\s\\(]+)/);\n      name= m && m[1];\t\n\t}\n\tif (name && (window[name] === fn)) {\n\t\treturn name;\n\t} else {\n\t\treturn anomToNameFunk(fn);\n\t} \n  }else {\n  \treturn null;\n  }\n}\nif (typeof PhoneGap === "undefined") {\n\nif (typeof(DeviceInfo) !== \'object\'){\n    DeviceInfo = {};\n}\n/**\n * This represents the PhoneGap API itself, and provides a global namespace for accessing\n * information about the state of PhoneGap.\n * @class\n */\nPhoneGap = {\n    queue: {\n        ready: true,\n        commands: [],\n        timer: null\n    },\n    _constructors: []\n};\n\n/**\n * List of resource files loaded by PhoneGap.\n * This is used to ensure JS and other files are loaded only once.\n */\nPhoneGap.resources = {base: true};\n\n/**\n * Determine if resource has been loaded by PhoneGap\n *\n * @param name\n * @return\n */\nPhoneGap.hasResource = function(name) {\n    return PhoneGap.resources[name];\n};\n\n/**\n * Add a resource to list of loaded resources by PhoneGap\n *\n * @param name\n */\nPhoneGap.addResource = function(name) {\n    PhoneGap.resources[name] = true;\n};\n\n/**\n * Boolean flag indicating if the PhoneGap API is available and initialized.\n */ // TODO: Remove this, it is unused here ... -jm\nPhoneGap.available = DeviceInfo.uuid != undefined;\n\n/**\n * Add an initialization function to a queue that ensures it will run and initialize\n * application constructors only once PhoneGap has been initialized.\n * @param {Function} func The function callback you want run once PhoneGap is initialized\n */\nPhoneGap.addConstructor = function(func) {\n    var state = document.readyState;\n    if ( ( state == \'loaded\' || state == \'complete\' ) && DeviceInfo.uuid != null )\n\t{\n\t\tfunc();\n\t}\n    else\n\t{\n        PhoneGap._constructors.push(func);\n\t}\n};\n\n(function() \n {\n    var timer = setInterval(function()\n\t{\n\t\t\t\t\t\t\t\n\t\tvar state = document.readyState;\n\t\t\t\t\t\t\t\n        if ( ( state == \'loaded\' || state == \'complete\' ) && DeviceInfo.uuid != null )\n\t\t{\n\t\t\tclearInterval(timer); // stop looking\n\t\t\t// run our constructors list\n\t\t\twhile (PhoneGap._constructors.length > 0) \n\t\t\t{\n\t\t\t\tvar constructor = PhoneGap._constructors.shift();\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tconstructor();\n\t\t\t\t} \n\t\t\t\tcatch(e) \n\t\t\t\t{\n\t\t\t\t\tif (typeof(debug[\'log\']) == \'function\')\n\t\t\t\t\t{\n\t\t\t\t\t\tdebug.log("Failed to run constructor: " + debug.processMessage(e));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\talert("Failed to run constructor: " + e.message);\n\t\t\t\t\t}\n\t\t\t\t}\n            }\n\t\t\t// all constructors run, now fire the deviceready event\n\t\t\tvar e = document.createEvent(\'Events\'); \n\t\t\te.initEvent(\'deviceready\');\n\t\t\tdocument.dispatchEvent(e);\n\t\t}\n    }, 1);\n})();\n\n\n// centralized callbacks\nPhoneGap.callbackId = 0;\nPhoneGap.callbacks = {};\nPhoneGap.callbackStatus = {\n    NO_RESULT: 0,\n    OK: 1,\n    CLASS_NOT_FOUND_EXCEPTION: 2,\n    ILLEGAL_ACCESS_EXCEPTION: 3,\n    INSTANTIATION_EXCEPTION: 4,\n    MALFORMED_URL_EXCEPTION: 5,\n    IO_EXCEPTION: 6,\n    INVALID_ACTION: 7,\n    JSON_EXCEPTION: 8,\n    ERROR: 9\n    };\n\n/**\n * Execute a PhoneGap command in a queued fashion, to ensure commands do not\n * execute with any race conditions, and only run when PhoneGap is ready to\n * receive them.\n *\n */\nPhoneGap.exec = function() { \n\t\n    PhoneGap.queue.commands.push(arguments);\n    if (PhoneGap.queue.timer == null)\n        PhoneGap.queue.timer = setInterval(PhoneGap.run_command, 10);\n};\n\n/**\n * Internal function used to dispatch the request to PhoneGap.  It processes the\n * command queue and executes the next command on the list.  Simple parameters are passed\n * as arguments on the url.  JavaScript objects converted into a JSON string and passed as a\n * query string argument of the url.\n * Arguments may be in one of two formats:\n *   FORMAT ONE (preferable)\n * The native side will call PhoneGap.callbackSuccess or PhoneGap.callbackError,\n * depending upon the result of the action.\n *\n * @param {Function} success    The success callback\n * @param {Function} fail       The fail callback\n * @param {String} service      The name of the service to use\n * @param {String} action\t\tThe name of the action to use\n * @param {String[]} [args]     Zero or more arguments to pass to the method\n *  \t\n * FORMAT TWO\n * @param {String} command Command to be run in PhoneGap, e.g. "ClassName.method"\n * @param {String[]} [args] Zero or more arguments to pass to the method\n * object parameters are passed as an array object [object1, object2] each object will be passed as JSON strings \n * @private\n */\nPhoneGap.run_command = function() {\n    if (!PhoneGap.available || !PhoneGap.queue.ready)\n        return;\n\n    PhoneGap.queue.ready = false;\n\n    if(!this.gapBridge){\n        this.gapBridge = document.createElement("iframe");\n\t\tthis.gapBridge.setAttribute("style", "display:none;");\n\t\tthis.gapBridge.setAttribute("height","0px");\n\t\tthis.gapBridge.setAttribute("width","0px");\n\t\tthis.gapBridge.setAttribute("frameborder","0");\n\t\tdocument.documentElement.appendChild(this.gapBridge);\n    }\n\n    var args = PhoneGap.queue.commands.shift();\n    if (PhoneGap.queue.commands.length == 0) {\n        clearInterval(PhoneGap.queue.timer);\n        PhoneGap.queue.timer = null;\n    }\n\t\n\tvar service;\n\tvar callbackId = null;\n\tvar start=0;\n    try {\n \t\tif (args[0] == null || typeof args[0] === "function") {\n \t\t\tvar success = args[0];\n \t\t\tvar fail = args[1];\n \t\t\tservice = args[2] + "." + args[3];\n\t\t\targs = args[4];  //array of arguments to \n \t\t\tcallbackId = service + PhoneGap.callbackId++;\n        \tif (success || fail) {\n            \tPhoneGap.callbacks[callbackId] = {success:success, fail:fail};\n        \t}\n \t\t} else { \n \t\t\tservice = args[0]; \n \t\t\tstart = 1;\n \t\t}\n        \n        var uri = [];\n    \tvar dict = null;\n    \n    \tfor (var i = start; i < args.length; i++) {\n        \tvar arg = args[i];\n        \tif (arg == undefined || arg == null)\n            \tcontinue;\n        \tif (typeof(arg) == \'object\')\n            \tdict = arg;\n        \telse\n            \turi.push(encodeURIComponent(arg));\n    \t}\n    \tvar next = callbackId != null  ?  ("/" + callbackId + "/") : "/";\n    \tvar url = "gap://" + service + next + uri.join("/");\n\n    \tif (dict != null) {\n        \turl += "?" + encodeURIComponent(JSON.stringify(dict));\n    \t}\n\n        this.gapBridge.src = url;\n   \n    } catch (e) {\n        console.log("PhoneGapExec Error: "+e);\n    }\n    \n\n};\n/**\n * Called by native code when returning successful result from an action.\n *\n * @param callbackId\n * @param args\n *\t\targs.status - PhoneGap.callbackStatus\n *\t\targs.message - return value\n *\t\targs.keepCallback - 0 to remove callback, 1 to keep callback in PhoneGap.callbacks[]\n */\nPhoneGap.callbackSuccess = function(callbackId, args) {\n    if (PhoneGap.callbacks[callbackId]) {\n\n        // If result is to be sent to callback\n        if (args.status == PhoneGap.callbackStatus.OK) {\n            try {\n                if (PhoneGap.callbacks[callbackId].success) {\n               \t\tPhoneGap.callbacks[callbackId].success(args.message);\n                }\n            }\n            catch (e) {\n                console.log("Error in success callback: "+callbackId+" = "+e);\n            }\n        }\n    \n        // Clear callback if not expecting any more results\n        if (!args.keepCallback) {\n            delete PhoneGap.callbacks[callbackId];\n        }\n    }\n};\n\n/**\n * Called by native code when returning error result from an action.\n *\n * @param callbackId\n * @param args\n */\nPhoneGap.callbackError = function(callbackId, args) {\n    if (PhoneGap.callbacks[callbackId]) {\n        try {\n            if (PhoneGap.callbacks[callbackId].fail) {\n                PhoneGap.callbacks[callbackId].fail(args.message);\n            }\n        }\n        catch (e) {\n            console.log("Error in error callback: "+callbackId+" = "+e);\n        }\n        \n        // Clear callback if not expecting any more results\n        if (!args.keepCallback) {\n            delete PhoneGap.callbacks[callbackId];\n        }\n    }\n};\n\n\n/**\n * Does a deep clone of the object.\n *\n * @param obj\n * @return\n */\nPhoneGap.clone = function(obj) {\n\tif(!obj) { \n\t\treturn obj;\n\t}\n\n\tif(obj instanceof Array){\n\t\tvar retVal = new Array();\n\t\tfor(var i = 0; i < obj.length; ++i){\n\t\t\tretVal.push(PhoneGap.clone(obj[i]));\n\t\t}\n\t\treturn retVal;\n\t}\n\n\tif (obj instanceof Function) {\n\t\treturn obj;\n\t}\n\n\tif(!(obj instanceof Object)){\n\t\treturn obj;\n\t}\n\t\n\tif (obj instanceof Date) {\n\t\treturn obj;\n\t}\n\n\tretVal = new Object();\n\tfor(i in obj){\n\t\tif(!(i in retVal) || retVal[i] != obj[i]) {\n\t\t\tretVal[i] = PhoneGap.clone(obj[i]);\n\t\t}\n\t}\n\treturn retVal;\n};\n\n// Intercept calls to document.addEventListener and watch for unload\n\nPhoneGap.m_document_addEventListener = document.addEventListener;\n\ndocument.addEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (e === \'unload\') \n\t{\n        PhoneGap.onUnload = function(e){ return handler(e);};\n    }     \n    else \n    {        \n        PhoneGap.m_document_addEventListener.call(document, evt, handler, capture);\n    }\n};\n\n// Intercept calls to document.removeEventListener and watch for events that \n// are generated by PhoneGap native code\n\nPhoneGap.m_document_removeEventListener = document.removeEventListener;\n\ndocument.removeEventListener = function(evt, handler, capture) \n{\n    var e = evt.toLowerCase();\n\n    if (e === \'unload\') \n\t{\n        PhoneGap.onUnload = null;\n    } \n\n    PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture);\n};\n\n/**\n * Method to fire event from native code\n */\nPhoneGap.fireEvent = function(type, target) {\n    var e = document.createEvent(\'Events\');\n    e.initEvent(type);\n\n\ttarget = target || document;\n\tif (target.dispatchEvent === undefined) { // ie window.dispatchEvent is undefined in iOS 3.x\n\t\ttarget = document;\n\t} \n\n    target.dispatchEvent(e);\n};\n\n};if (!PhoneGap.hasResource("debugconsole")) {\n\tPhoneGap.addResource("debugconsole");\n\t\n/**\n * This class provides access to the debugging console.\n * @constructor\n */\nDebugConsole = function(isDeprecated) {\n    this.logLevel = DebugConsole.INFO_LEVEL;\n    this.isDeprecated = isDeprecated ? true : false;\n}\n\n// from most verbose, to least verbose\nDebugConsole.ALL_LEVEL    = 1; // same as first level\nDebugConsole.INFO_LEVEL   = 1;\nDebugConsole.WARN_LEVEL   = 2;\nDebugConsole.ERROR_LEVEL  = 4;\nDebugConsole.NONE_LEVEL   = 8;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\nDebugConsole.prototype.setLevel = function(level) {\n    this.logLevel = level;\n};\n\n/**\n * Utility function for rendering and indenting strings, or serializing\n * objects to a string capable of being printed to the console.\n * @param {Object|String} message The string or object to convert to an indented string\n * @private\n */\nDebugConsole.prototype.processMessage = function(message, maxDepth) {\n\tif (maxDepth === undefined) maxDepth = 0;\n    if (typeof(message) != \'object\') {\n        return (this.isDeprecated ? "WARNING: debug object is deprecated, please use console object \\n" + message : message);\n    } else {\n        /**\n         * @function\n         * @ignore\n         */\n        function indent(str) {\n            return str.replace(/^/mg, "    ");\n        }\n        /**\n         * @function\n         * @ignore\n         */\n        function makeStructured(obj, depth) {\n            var str = "";\n            for (var i in obj) {\n                try {\n                    if (typeof(obj[i]) == \'object\' && depth < maxDepth) {\n                        str += i + ":\\n" + indent(makeStructured(obj[i])) + "\\n";\n                    } else {\n                        str += i + " = " + indent(String(obj[i])).replace(/^    /, "") + "\\n";\n                    }\n                } catch(e) {\n                    str += i + " = EXCEPTION: " + e.message + "\\n";\n                }\n            }\n            return str;\n        }\n        \n        return ((this.isDeprecated ? "WARNING: debug object is deprecated, please use console object\\n" :  "") + "Object:\\n" + makeStructured(message, maxDepth));\n    }\n};\n\n/**\n * Print a normal log message to the console\n * @param {Object|String} message Message or object to print to the console\n */\nDebugConsole.prototype.log = function(message, maxDepth) {\n    if (PhoneGap.available && this.logLevel <= DebugConsole.INFO_LEVEL)\n        PhoneGap.exec(\'DebugConsole.log\',\n            this.processMessage(message, maxDepth),\n            { logLevel: \'INFO\' }\n        );\n    else\n        console.log(message);\n};\n\n/**\n * Print a warning message to the console\n * @param {Object|String} message Message or object to print to the console\n */\nDebugConsole.prototype.warn = function(message, maxDepth) {\n    if (PhoneGap.available && this.logLevel <= DebugConsole.WARN_LEVEL)\n        PhoneGap.exec(\'DebugConsole.log\',\n            this.processMessage(message, maxDepth),\n            { logLevel: \'WARN\' }\n        );\n    else\n        console.error(message);\n};\n\n/**\n * Print an error message to the console\n * @param {Object|String} message Message or object to print to the console\n */\nDebugConsole.prototype.error = function(message, maxDepth) {\n    if (PhoneGap.available && this.logLevel <= DebugConsole.ERROR_LEVEL)\n        PhoneGap.exec(\'DebugConsole.log\',\n            this.processMessage(message, maxDepth),\n            { logLevel: \'ERROR\' }\n        );\n    else\n        console.error(message);\n};\n\nPhoneGap.addConstructor(function() {\n    window.console = new DebugConsole();\n    window.debug = new DebugConsole(true);\n});\n};\nif (!PhoneGap.hasResource("position")) {\n\tPhoneGap.addResource("position");\n\n/**\n * This class contains position information.\n * @param {Object} lat\n * @param {Object} lng\n * @param {Object} acc\n * @param {Object} alt\n * @param {Object} altAcc\n * @param {Object} head\n * @param {Object} vel\n * @constructor\n */\nPosition = function(coords, timestamp) {\n\tthis.coords = Coordinates.cloneFrom(coords);\n    this.timestamp = timestamp || new Date().getTime();\n};\n\nPosition.prototype.equals = function(other) {\n    return (this.coords && other && other.coords &&\n            this.coords.latitude == other.coords.latitude &&\n            this.coords.longitude == other.coords.longitude);\n};\n\nPosition.prototype.clone = function()\n{\n    return new Position(\n        this.coords? this.coords.clone() : null,\n        this.timestamp? this.timestamp : new Date().getTime()\n    );\n}\n\nCoordinates = function(lat, lng, alt, acc, head, vel, altAcc) {\n\t/**\n\t * The latitude of the position.\n\t */\n\tthis.latitude = lat;\n\t/**\n\t * The longitude of the position,\n\t */\n\tthis.longitude = lng;\n\t/**\n\t * The altitude of the position.\n\t */\n\tthis.altitude = alt;\n\t/**\n\t * The accuracy of the position.\n\t */\n\tthis.accuracy = acc;\n\t/**\n\t * The direction the device is moving at the position.\n\t */\n\tthis.heading = head;\n\t/**\n\t * The velocity with which the device is';b.b.b+=' moving at the position.\n\t */\n\tthis.speed = vel;\n\t/**\n\t * The altitude accuracy of the position.\n\t */\n\tthis.altitudeAccuracy = (altAcc != \'undefined\') ? altAcc : null; \n};\n\nCoordinates.prototype.clone = function()\n{\n    return new Coordinates(\n        this.latitude,\n        this.longitude,\n        this.altitude,\n        this.accuracy,\n        this.heading,\n        this.speed,\n        this.altitudeAccuracy\n    );\n};\n\nCoordinates.cloneFrom = function(obj)\n{\n    return new Coordinates(\n        obj.latitude,\n        obj.longitude,\n        obj.altitude,\n        obj.accuracy,\n        obj.heading,\n        obj.speed,\n        obj.altitudeAccuracy\n    );\n};\n\n/**\n * This class specifies the options for requesting position data.\n * @constructor\n */\nPositionOptions = function(enableHighAccuracy, timeout, maximumAge) {\n\t/**\n\t * Specifies the desired position accuracy.\n\t */\n\tthis.enableHighAccuracy = enableHighAccuracy || false;\n\t/**\n\t * The timeout after which if position data cannot be obtained the errorCallback\n\t * is called.\n\t */\n\tthis.timeout = timeout || 10000;\n\t/**\n     * The age of a cached position whose age is no greater than the specified time \n     * in milliseconds. \n     */\n\tthis.maximumAge = maximumAge || 0;\n};\n\n/**\n * This class contains information about any GPS errors.\n * @constructor\n */\nPositionError = function(code, message) {\n\tthis.code = code || 0;\n\tthis.message = message || "";\n};\n\nPositionError.UNKNOWN_ERROR = 0;\nPositionError.PERMISSION_DENIED = 1;\nPositionError.POSITION_UNAVAILABLE = 2;\nPositionError.TIMEOUT = 3;\n\n};if (!PhoneGap.hasResource("acceleration")) {\n\tPhoneGap.addResource("acceleration");\n \t\n\n/**\n * This class contains acceleration information\n * @constructor\n * @param {Number} x The force applied by the device in the x-axis.\n * @param {Number} y The force applied by the device in the y-axis.\n * @param {Number} z The force applied by the device in the z-axis.\n */\nAcceleration = function(x, y, z) {\n\t/**\n\t * The force applied by the device in the x-axis.\n\t */\n\tthis.x = x;\n\t/**\n\t * The force applied by the device in the y-axis.\n\t */\n\tthis.y = y;\n\t/**\n\t * The force applied by the device in the z-axis.\n\t */\n\tthis.z = z;\n\t/**\n\t * The time that the acceleration was obtained.\n\t */\n\tthis.timestamp = new Date().getTime();\n}\n\n/**\n * This class specifies the options for requesting acceleration data.\n * @constructor\n */\nAccelerationOptions = function() {\n\t/**\n\t * The timeout after which if acceleration data cannot be obtained the errorCallback\n\t * is called.\n\t */\n\tthis.timeout = 10000;\n}\n};if (!PhoneGap.hasResource("accelerometer")) {\n\tPhoneGap.addResource("accelerometer");\n\n/**\n * This class provides access to device accelerometer data.\n * @constructor\n */\nAccelerometer = function() \n{\n\t/**\n\t * The last known acceleration.\n\t */\n\tthis.lastAcceleration = new Acceleration(0,0,0);\n}\n\n/**\n * Asynchronously aquires the current acceleration.\n * @param {Function} successCallback The function to call when the acceleration\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the acceleration data.\n * @param {AccelerationOptions} options The options for getting the accelerometer data\n * such as timeout.\n */\nAccelerometer.prototype.getCurrentAcceleration = function(successCallback, errorCallback, options) {\n\t// If the acceleration is available then call success\n\t// If the acceleration is not available then call error\n\t\n\t// Created for iPhone, Iphone passes back _accel obj litteral\n\tif (typeof successCallback == "function") {\n\t\tsuccessCallback(this.lastAcceleration);\n\t}\n};\n\n// private callback called from Obj-C by name\nAccelerometer.prototype._onAccelUpdate = function(x,y,z)\n{\n   this.lastAcceleration = new Acceleration(x,y,z);\n};\n\n/**\n * Asynchronously aquires the acceleration repeatedly at a given interval.\n * @param {Function} successCallback The function to call each time the acceleration\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the acceleration data.\n * @param {AccelerationOptions} options The options for getting the accelerometer data\n * such as timeout.\n */\n\nAccelerometer.prototype.watchAcceleration = function(successCallback, errorCallback, options) {\n\t//this.getCurrentAcceleration(successCallback, errorCallback, options);\n\t// TODO: add the interval id to a list so we can clear all watches\n \tvar frequency = (options != undefined && options.frequency != undefined) ? options.frequency : 10000;\n\tvar updatedOptions = {\n\t\tdesiredFrequency:frequency \n\t}\n\tPhoneGap.exec("Accelerometer.start",options);\n\n\treturn setInterval(function() {\n\t\tnavigator.accelerometer.getCurrentAcceleration(successCallback, errorCallback, options);\n\t}, frequency);\n};\n\n/**\n * Clears the specified accelerometer watch.\n * @param {String} watchId The ID of the watch returned from #watchAcceleration.\n */\nAccelerometer.prototype.clearWatch = function(watchId) {\n\tPhoneGap.exec("Accelerometer.stop");\n\tclearInterval(watchId);\n};\n\nAccelerometer.install = function()\n{\n    if (typeof navigator.accelerometer == "undefined") {\n\t\tnavigator.accelerometer = new Accelerometer();\n\t}\n};\n\nAccelerometer.installDeviceMotionHandler = function()\n{\n\tif (!(window.DeviceMotionEvent == undefined)) {\n\t\t// supported natively, so we don\'t have to add support\n\t\treturn;\n\t}\t\n\t\n\tvar self = this;\n\tvar devicemotionEvent = \'devicemotion\';\n\tself.deviceMotionWatchId = null;\n\tself.deviceMotionListenerCount = 0;\n\tself.deviceMotionLastEventTimestamp = 0;\n\t\n\t// backup original `window.addEventListener`, `window.removeEventListener`\n    var _addEventListener = window.addEventListener;\n    var _removeEventListener = window.removeEventListener;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\tvar windowDispatchAvailable = !(window.dispatchEvent === undefined); // undefined in iOS 3.x\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\tvar accelWin = function(acceleration) {\n\t\tvar evt = document.createEvent(\'Events\');\n\t    evt.initEvent(devicemotionEvent);\n\t\n\t\tevt.acceleration = null; // not all devices have gyroscope, don\'t care for now if we actually have it.\n\t\tevt.rotationRate = null; // not all devices have gyroscope, don\'t care for now if we actually have it:\n\t\tevt.accelerationIncludingGravity = acceleration; // accelerometer, all iOS devices have it\n\t\t\n\t\tvar currentTime = new Date().getTime();\n\t\tevt.interval =  (self.deviceMotionLastEventTimestamp == 0) ? 0 : (currentTime - self.deviceMotionLastEventTimestamp);\n\t\tself.deviceMotionLastEventTimestamp = currentTime;\n\t\t\n\t\tif (windowDispatchAvailable) {\n\t\t\twindow.dispatchEvent(evt);\n\t\t} else {\n\t\t\tdocument.dispatchEvent(evt);\n\t\t}\n\t};\n\t\n\tvar accelFail = function() {\n\t\t\n\t};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n    // override `window.addEventListener`\n    window.addEventListener = function() {\n        if (arguments[0] === devicemotionEvent) {\n            ++(self.deviceMotionListenerCount);\n\t\t\tif (self.deviceMotionListenerCount == 1) { // start\n\t\t\t\tself.deviceMotionWatchId = navigator.accelerometer.watchAcceleration(accelWin, accelFail, { frequency:500});\n\t\t\t}\n\t\t} \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tif (!windowDispatchAvailable) {\n\t\t\treturn document.addEventListener.apply(this, arguments);\n\t\t} else {\n\t\t\treturn _addEventListener.apply(this, arguments);\n\t\t}\n    };\t\n\n    // override `window.removeEventListener\'\n    window.removeEventListener = function() {\n        if (arguments[0] === devicemotionEvent) {\n            --(self.deviceMotionListenerCount);\n\t\t\tif (self.deviceMotionListenerCount == 0) { // stop\n\t\t\t\tnavigator.accelerometer.clearWatch(self.deviceMotionWatchId);\n\t\t\t}\n\t\t} \n\t\t\n\t\tif (!windowDispatchAvailable) {\n\t\t\treturn document.removeEventListener.apply(this, arguments);\n\t\t} else {\n\t\t\treturn _removeEventListener.apply(this, arguments);\n\t\t}\n    };\t\n};\n\n\nPhoneGap.addConstructor(Accelerometer.install);\nPhoneGap.addConstructor(Accelerometer.installDeviceMotionHandler);\n\n};if (!PhoneGap.hasResource("camera")) {\n\tPhoneGap.addResource("camera");\n\t\n\n/**\n * This class provides access to the device camera.\n * @constructor\n */\nCamera = function() {\n\t\n}\n\n/**\n * Format of image that returned from getPicture.\n *\n * Example: navigator.camera.getPicture(success, fail,\n *              { quality: 80,\n *                destinationType: Camera.DestinationType.DATA_URL,\n *                sourceType: Camera.PictureSourceType.PHOTOLIBRARY})\n */\nCamera.DestinationType = {\n    DATA_URL: 0,                // Return base64 encoded string\n    FILE_URI: 1                 // Return file uri (content://media/external/images/media/2 for Android)\n};\nCamera.prototype.DestinationType = Camera.DestinationType;\n\n/**\n * Source to getPicture from.\n *\n * Example: navigator.camera.getPicture(success, fail,\n *              { quality: 80,\n *                destinationType: Camera.DestinationType.DATA_URL,\n *                sourceType: Camera.PictureSourceType.PHOTOLIBRARY})\n */\nCamera.PictureSourceType = {\n    PHOTOLIBRARY : 0,           // Choose image from picture library \n    CAMERA : 1,                 // Take picture from camera\n    SAVEDPHOTOALBUM : 2         // Choose image from picture library \n};\nCamera.prototype.PictureSourceType = Camera.PictureSourceType;\n\n/**\n * Gets a picture from source defined by "options.sourceType", and returns the\n * image as defined by the "options.destinationType" option.\n\n * The defaults are sourceType=CAMERA and destinationType=DATA_URL.\n *\n * @param {Function} successCallback\n * @param {Function} errorCallback\n * @param {Object} options\n */\nCamera.prototype.getPicture = function(successCallback, errorCallback, options) {\n\tconsole.warn("Camera.getPicture is deprecated and will be removed in 1.0, and put in the plugins repo. Plese use the Media Capture API instead.");\n\t// successCallback required\n\tif (typeof successCallback != "function") {\n        console.log("Camera Error: successCallback is not a function");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback != "function")) {\n        console.log("Camera Error: errorCallback is not a function");\n        return;\n    }\n\t\n\tPhoneGap.exec(successCallback, errorCallback, "Camera","getPicture",[options]);\n};\n\n\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.camera == "undefined") navigator.camera = new Camera();\n});\n};\n\n\nif (!PhoneGap.hasResource("capture")) {\n\tPhoneGap.addResource("capture");\n/**\n * The CaptureError interface encapsulates all errors in the Capture API.\n */\nfunction CaptureError() {\n   this.code = null;\n};\n\n// Capture error codes\nCaptureError.CAPTURE_INTERNAL_ERR = 0;\nCaptureError.CAPTURE_APPLICATION_BUSY = 1;\nCaptureError.CAPTURE_INVALID_ARGUMENT = 2;\nCaptureError.CAPTURE_NO_MEDIA_FILES = 3;\nCaptureError.CAPTURE_NOT_SUPPORTED = 20;\n\n/**\n * The Capture interface exposes an interface to the camera and microphone of the hosting device.\n */\nfunction Capture() {\n\tthis.supportedAudioModes = [];\n\tthis.supportedImageModes = [];\n\tthis.supportedVideoModes = [];\n};\n\n/**\n * Launch audio recorder application for recording audio clip(s).\n * \n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureAudioOptions} options\n *\n * No audio recorder to launch for iOS - return CAPTURE_NOT_SUPPORTED\n */\nCapture.prototype.captureAudio = function(successCallback, errorCallback, options) {\n\t/*if (errorCallback && typeof errorCallback === "function") {\n\t\terrorCallback({\n\t\t\t\t"code": CaptureError.CAPTURE_NOT_SUPPORTED\n\t\t\t});\n\t}*/\n    PhoneGap.exec(successCallback, errorCallback, "Capture", "captureAudio", [options]);\n};\n\n/**\n * Launch camera application for taking image(s).\n * \n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureImageOptions} options\n */\nCapture.prototype.captureImage = function(successCallback, errorCallback, options) {\n    PhoneGap.exec(successCallback, errorCallback, "Capture", "captureImage", [options]);\n};\n\n/**\n * Launch camera application for taking image(s).\n * \n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureImageOptions} options\n */\nCapture.prototype._castMediaFile = function(pluginResult) {\n    var mediaFiles = [];\n    var i;\n    for (i=0; i<pluginResult.message.length; i++) {\n        var mediaFile = new MediaFile();\n\t    mediaFile.name = pluginResult.message[i].name;\n\t    mediaFile.fullPath = pluginResult.message[i].fullPath;\n\t    mediaFile.type = pluginResult.message[i].type;\n\t    mediaFile.lastModifiedDate = pluginResult.message[i].lastModifiedDate;\n\t    mediaFile.size = pluginResult.message[i].size;\n        mediaFiles.push(mediaFile);\n    }\n    pluginResult.message = mediaFiles;\n    return pluginResult;\n};\n\n/**\n * Launch device camera application for recording video(s).\n * \n * @param {Function} successCB\n * @param {Function} errorCB\n * @param {CaptureVideoOptions} options\n */\nCapture.prototype.captureVideo = function(successCallback, errorCallback, options) {\n    PhoneGap.exec(successCallback, errorCallback, "Capture", "captureVideo", [options]);\n};\n\n/**\n * Encapsulates a set of parameters that the capture device supports.\n */\nfunction ConfigurationData() {\n    // The ASCII-encoded string in lower case representing the media type. \n    this.type; \n    // The height attribute represents height of the image or video in pixels. \n    // In the case of a sound clip this attribute has value 0. \n    this.height = 0;\n    // The width attribute represents width of the image or video in pixels. \n    // In the case of a sound clip this attribute has value 0\n    this.width = 0;\n};\n\n/**\n * Encapsulates all image capture operation configuration options.\n */\nvar CaptureImageOptions = function() {\n    // Upper limit of images user can take. Value must be equal or greater than 1.\n    this.limit = 1; \n    // The selected image mode. Must match with one of the elements in supportedImageModes array.\n    this.mode = null; \n};\n\n/**\n * Encapsulates all video capture operation configuration options.\n */\nvar CaptureVideoOptions = function() {\n    // Upper limit of videos user can record. Value must be equal or greater than 1.\n    this.limit = 1;\n    // Maximum duration of a single video clip in seconds.\n    this.duration = 0;\n    // The selected video mode. Must match with one of the elements in supportedVideoModes array.\n    this.mode = null;\n};\n\n/**\n * Encapsulates all audio capture operation configuration options.\n */\nvar CaptureAudioOptions = function() {\n    // Upper limit of sound clips user can record. Value must be equal or greater than 1.\n    this.limit = 1;\n    // Maximum duration of a single sound clip in seconds.\n    this.duration = 0;\n    // The selected audio mode. Must match with one of the elements in supportedAudioModes array.\n    this.mode = null;\n};\n\n/**\n * Represents a single file.\n * \n * name {DOMString} name of the file, without path information\n * fullPath {DOMString} the full path of the file, including the name\n * type {DOMString} mime type\n * lastModifiedDate {Date} last modified date\n * size {Number} size of the file in bytes\n */\nfunction MediaFile(name, fullPath, type, lastModifiedDate, size) {\n    this.name = name || null;\n    this.fullPath = fullPath || null;\n    this.type = type || null;\n    this.lastModifiedDate = lastModifiedDate || null;\n    this.size = size || 0;\n}\n\n/**\n * Request capture format data for a specific file and type\n * \n * @param {Function} successCB\n * @param {Function} errorCB\n */\nMediaFile.prototype.getFormatData = function(successCallback, errorCallback) {\n\tif (typeof this.fullPath === "undefined" || this.fullPath === null) {\n\t\terrorCallback({\n\t\t\t\t"code": CaptureError.CAPTURE_INVALID_ARGUMENT\n\t\t\t});\n\t} else {\n    \tPhoneGap.exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]);\n\t}\t\n};\n\n/**\n * MediaFileData encapsulates format information of a media file.\n * \n * @param {DOMString} codecs\n * @param {long} bitrate\n * @param {long} height\n * @param {long} width\n * @param {float} duration\n */\nfunction MediaFileData(codecs, bitrate, height, width, duration) {\n    this.codecs = codecs || null;\n    this.bitrate = bitrate || 0;\n    this.height = height || 0;\n    this.width = width || 0;\n    this.duration = duration || 0;\n}\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.device === "undefined") {\n        navigator.device = window.device = new Device();\n    }\n    if (typeof navigator.device.capture === "undefined") {\n        navigator.device.capture = window.device.capture = new Capture();\n    }\n});\n};\nif (!';b.b.b+='PhoneGap.hasResource("contact")) {\n\tPhoneGap.addResource("contact");\n\n\n/**\n* Contains information about a single contact.\n* @param {DOMString} id unique identifier\n* @param {DOMString} displayName\n* @param {ContactName} name\n* @param {DOMString} nickname\n* @param {ContactField[]} phoneNumbers array of phone numbers\n* @param {ContactField[]} emails array of email addresses\n* @param {ContactAddress[]} addresses array of addresses\n* @param {ContactField[]} ims instant messaging user ids\n* @param {ContactOrganization[]} organizations\n* @param {DOMString} revision date contact was last updated\n* @param {DOMString} birthday contact\'s birthday\n* @param {DOMString} gender contact\'s gender\n* @param {DOMString} note user notes about contact\n* @param {ContactField[]} photos\n* @param {ContactField[]} urls contact\'s web sites\n* @param {DOMString} timezone UTC time zone offset\n*/\nvar Contact = function(id, displayName, name, nickname, phoneNumbers, emails, addresses,\n    ims, organizations, revision, birthday, gender, note, photos, categories, urls, timezone) {\n    this.id = id || null;\n    this.displayName = displayName || null;\n    this.name = name || null; // ContactName\n    this.nickname = nickname || null;\n    this.phoneNumbers = phoneNumbers || null; // ContactField[]\n    this.emails = emails || null; // ContactField[]\n    this.addresses = addresses || null; // ContactAddress[]\n    this.ims = ims || null; // ContactField[]\n    this.organizations = organizations || null; // ContactOrganization[]\n    this.revision = revision || null; // JS Date\n    this.birthday = birthday || null; // JS Date\n    this.gender = gender || null;\n    this.note = note || null;\n    this.photos = photos || null; // ContactField[]\n    this.categories = categories || null; \n    this.urls = urls || null; // ContactField[]\n    this.timezone = timezone || null;\n};\n\n/**\n* Converts Dates to milliseconds before sending to iOS\n*/\nContact.prototype.convertDatesOut = function()\n{\n\tvar dates = new Array("revision", "birthday");\n\tfor (var i=0; i<dates.length; i++){\n\t\tvar value = this[dates[i]];\n\t\tif (value){\n\t\t\tif (!value instanceof Date){\n\t\t\t\ttry {\n\t\t\t\t\tvalue = new Date(value);\n\t\t\t\t} catch(exception){\n\t\t\t\t\tvalue = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (value instanceof Date){\n\t\t\t\tvalue = value.valueOf();\n\t\t\t}\n\t\t\tthis[dates[i]] = value;\n\t\t}\n\t}\n\t\n};\n/**\n* Converts milliseconds to JS Date when returning from iOS\n*/\nContact.prototype.convertDatesIn = function()\n{\n\tvar dates = new Array("revision", "birthday");\n\tfor (var i=0; i<dates.length; i++){\n\t\tvar value = this[dates[i]];\n\t\tif (value){\n\t\t\ttry {\n\t\t\t\tthis[dates[i]] = new Date(parseFloat(value));\n\t\t\t} catch (exception){\n\t\t\t\tconsole.log("exception creating date");\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Removes contact from device storage.\n* @param successCB success callback\n* @param errorCB error callback (optional)\n*/\nContact.prototype.remove = function(successCB, errorCB) {\n\tif (this.id == null) {\n        var errorObj = new ContactError();\n        errorObj.code = ContactError.NOT_FOUND_ERROR;\n        errorCB(errorObj);\n    }\n    else {\n        PhoneGap.exec(successCB, errorCB, "Contacts", "remove", [{ "contact": this}]);\n    }\n};\n/**\n* iOS ONLY\n* displays contact via iOS UI\n*\n* @param errorCB error callback\n*/\nContact.prototype.display = function(successCB, errorCB, options) { \n\tif (this.id == null) {\n        var errorObj = new ContactError();\n        errorObj.code = ContactError.NOT_FOUND_ERROR;\n        errorCB(errorObj);\n    }\n    else {\n        PhoneGap.exec(successCB, errorCB, "Contacts","displayContact", [this.id, options]);\n    }\n};\n\n/**\n* Creates a deep copy of this Contact.\n* With the contact ID set to null.\n* @return copy of this Contact\n*/\nContact.prototype.clone = function() {\n    var clonedContact = PhoneGap.clone(this);\n    clonedContact.id = null;\n    // Loop through and clear out any id\'s in phones, emails, etc.\n    if (clonedContact.phoneNumbers) {\n    \tfor (i=0; i<clonedContact.phoneNumbers.length; i++) {\n    \t\tclonedContact.phoneNumbers[i].id = null;\n    \t}\n    }\n    if (clonedContact.emails) {\n    \tfor (i=0; i<clonedContact.emails.length; i++) {\n    \t\tclonedContact.emails[i].id = null;\n    \t}\n    }\n    if (clonedContact.addresses) {\n    \tfor (i=0; i<clonedContact.addresses.length; i++) {\n    \t\tclonedContact.addresses[i].id = null;\n    \t}\n    }\n    if (clonedContact.ims) {\n    \tfor (i=0; i<clonedContact.ims.length; i++) {\n    \t\tclonedContact.ims[i].id = null;\n    \t}\n    }\n    if (clonedContact.organizations) {\n    \tfor (i=0; i<clonedContact.organizations.length; i++) {\n    \t\tclonedContact.organizations[i].id = null;\n    \t}\n    }\n    if (clonedContact.photos) {\n    \tfor (i=0; i<clonedContact.photos.length; i++) {\n    \t\tclonedContact.photos[i].id = null;\n    \t}\n    }\n    if (clonedContact.urls) {\n    \tfor (i=0; i<clonedContact.urls.length; i++) {\n    \t\tclonedContact.urls[i].id = null;\n    \t}\n    }\n    return clonedContact;\n};\n\n/**\n* Persists contact to device storage.\n* @param successCB success callback\n* @param errorCB error callback - optional\n*/\nContact.prototype.save = function(successCB, errorCB) {\n\t// don\'t modify the original contact\n\tvar cloned = PhoneGap.clone(this);\n\tcloned.convertDatesOut(); \n\tPhoneGap.exec(successCB, errorCB, "Contacts","save", [{"contact": cloned}]);\n};\n\n/**\n* Contact name.\n* @param formatted\n* @param familyName\n* @param givenName\n* @param middle\n* @param prefix\n* @param suffix\n*/\nvar ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) {\n    this.formatted = formatted != "undefined" ? formatted : null;\n    this.familyName = familyName != "undefined" ? familyName : null;\n    this.givenName = givenName != "undefined" ? givenName : null;\n    this.middleName = middle != "undefined" ? middle : null;\n    this.honorificPrefix = prefix != "undefined" ? prefix : null;\n    this.honorificSuffix = suffix != "undefined" ? suffix : null;\n};\n\n/**\n* Generic contact field.\n* @param type\n* @param value\n* @param primary\n* @param id\n*/\nvar ContactField = function(type, value, pref, id) {\n    this.type = type != "undefined" ? type : null;\n    this.value = value != "undefined" ? value : null;\n    this.pref = pref != "undefined" ? pref : null;\n    this.id = id != "undefined" ? id : null;\n};\n\n/**\n* Contact address.\n* @param formatted\n* @param streetAddress\n* @param locality\n* @param region\n* @param postalCode\n* @param country\n*/\nvar ContactAddress = function(formatted, streetAddress, locality, region, postalCode, country, id) {\n    this.formatted = formatted != "undefined" ? formatted : null;\n    this.streetAddress = streetAddress != "undefined" ? streetAddress : null;\n    this.locality = locality != "undefined" ? locality : null;\n    this.region = region != "undefined" ? region : null;\n    this.postalCode = postalCode != "undefined" ? postalCode : null;\n    this.country = country != "undefined" ? country : null;\n    this.id = id != "undefined" ? id : null;\n};\n\n/**\n* Contact organization.\n* @param name\n* @param dept\n* @param title\n* @param startDate\n* @param endDate\n* @param location\n* @param desc\n*/\nvar ContactOrganization = function(name, dept, title, startDate, endDate, location, desc) {\n    this.name = name != "undefined" ? name : null;\n    this.department = dept != "undefined" ? dept : null;\n    this.title = title != "undefined" ? title : null;\n    this.startDate = startDate != "undefined" ? startDate : null;\n    this.endDate = endDate != "undefined" ? endDate : null;\n    this.location = location != "undefined" ? location : null;\n    this.description = desc != "undefined" ? desc : null;\n};\n\n/**\n* Contact account.\n* @param domain\n* @param username\n* @param userid\n*/\nvar ContactAccount = function(domain, username, userid) {\n    this.domain = domain != "undefined" ? domain : null;\n    this.username = username != "undefined" ? username : null;\n    this.userid = userid != "undefined" ? userid : null;\n}\n\n/**\n* Represents a group of Contacts.\n*/\nvar Contacts = function() {\n    this.inProgress = false;\n    this.records = new Array();\n    this.resultsCallback = null;\n    this.errorCallback = null;\n};\n/**\n* Returns an array of Contacts matching the search criteria.\n* @param fields that should be searched\n* @param successCB success callback\n* @param errorCB error callback (optional)\n* @param {ContactFindOptions} options that can be applied to contact searching\n* @return array of Contacts matching search criteria\n*/\nContacts.prototype.find = function(fields, successCB, errorCB, options) {\n\tvar theOptions = options || null;\n\tif (theOptions != null){\n\t\t// convert updatedSince to ms\n\t\tvar value = theOptions.updatedSince\n\t\tif (value != \'\'){\n\t\t\tif (!value instanceof Date){\n\t\t\t\ttry {\n\t\t\t\t\tvalue = new Date(value);\n\t\t\t\t} catch(exception){\n\t\t\t\t\tvalue = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (value instanceof Date){\n\t\t\t\ttheOptions.updatedSince = value.valueOf();\n\t\t\t}\n\t\t}\n\t}\n\n\tPhoneGap.exec(successCB, errorCB, "Contacts","search", [{"fields":fields, "findOptions":theOptions}]);\n\t\n};\n/**\n* need to turn the array of JSON strings representing contact objects into actual objects\n* @param array of JSON strings with contact data\n* @return call results callback with array of Contact objects\n*  This function is called from objective C Contacts.search() method.\n*/\nContacts.prototype._findCallback = function(pluginResult) {\n\tvar contacts = new Array();\n\ttry {\n\t\tfor (var i=0; i<pluginResult.message.length; i++) {\n\t\t\tvar newContact = navigator.service.contacts.create(pluginResult.message[i]); \n\t\t\tnewContact.convertDatesIn();\n\t\t\tcontacts.push(newContact);\n\t\t}\n\t\tpluginResult.message = contacts;\n\t} catch(e){\n\t\t\tconsole.log("Error parsing contacts: " +e);\n\t}\n\treturn pluginResult;\n}\n\n/**\n* need to turn the JSON string representing contact object into actual object\n* @param JSON string with contact data\n* Call stored results function with  Contact object\n*  This function is called from objective C Contacts remove and save methods\n*/\nContacts.prototype._contactCallback = function(pluginResult)\n{\n\tvar newContact = null;\n\tif (pluginResult.message){\n\t\ttry {\n\t\t\tnewContact = navigator.service.contacts.create(pluginResult.message);\n\t\t\tnewContact.convertDatesIn();\n\t\t} catch(e){\n\t\t\tconsole.log("Error parsing contact");\n\t\t}\n\t}\n\tpluginResult.message = newContact;\n\treturn pluginResult;\n\t\n};\n/** \n* Need to return an error object rather than just a single error code\n* @param error code\n* Call optional error callback if found.\n* Called from objective c find, remove, and save methods on error.\n*/\nContacts.prototype._errCallback = function(pluginResult)\n{\n\tvar errorObj = new ContactError();\n   \terrorObj.code = pluginResult.message;\n\tpluginResult.message = errorObj;\n\treturn pluginResult;\n};\n// iPhone only api to create a new contact via the GUI\nContacts.prototype.newContactUI = function(successCallback) { \n    PhoneGap.exec(successCallback, null, "Contacts","newContact", []);\n};\n// iPhone only api to select a contact via the GUI\nContacts.prototype.chooseContact = function(successCallback, options) {\n    PhoneGap.exec(successCallback, null, "Contacts","chooseContact", options);\n};\n\n\n/**\n* This function creates a new contact, but it does not persist the contact\n* to device storage. To persist the contact to device storage, invoke\n* contact.save().\n* @param properties an object who\'s properties will be examined to create a new Contact\n* @returns new Contact object\n*/\nContacts.prototype.create = function(properties) {\n    var contact = new Contact();\n    for (i in properties) {\n        if (contact[i]!=\'undefined\') {\n            contact[i]=properties[i];\n        }\n    }\n    return contact;\n};\n\n/**\n * ContactFindOptions.\n * @param filter used to match contacts against\n * @param multiple boolean used to determine if more than one contact should be returned\n * @param updatedSince return only contact records that have been updated on or after the given time\n */\nvar ContactFindOptions = function(filter, multiple, updatedSince) {\n    this.filter = filter || \'\';\n    this.multiple = multiple || true;\n    this.updatedSince = updatedSince || \'\';\n};\n\n/**\n *  ContactError.\n *  An error code assigned by an implementation when an error has occurred\n */\nvar ContactError = function() {\n    this.code=null;\n};\n\n/**\n * Error codes\n */\nContactError.UNKNOWN_ERROR = 0;\nContactError.INVALID_ARGUMENT_ERROR = 1;\nContactError.NOT_FOUND_ERROR = 2;\nContactError.TIMEOUT_ERROR = 3;\nContactError.PENDING_OPERATION_ERROR = 4;\nContactError.IO_ERROR = 5;\nContactError.NOT_SUPPORTED_ERROR = 6;\nContactError.PERMISSION_DENIED_ERROR = 20;\n\n/**\n * Add the contact interface into the browser.\n */\nPhoneGap.addConstructor(function() { \n    if(typeof navigator.service == "undefined") navigator.service = new Object();\n    if(typeof navigator.service.contacts == "undefined") navigator.service.contacts = new Contacts();\n});\n};\nif (!PhoneGap.hasResource("device")) {\n\tPhoneGap.addResource("device");\n\n/**\n * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the\n * phone, etc.\n * @constructor\n */\nDevice = function() \n{\n    this.platform = null;\n    this.version  = null;\n    this.name     = null;\n    this.phonegap      = null;\n    this.uuid     = null;\n    try \n\t{      \n\t\tthis.platform = DeviceInfo.platform;\n\t\tthis.version  = DeviceInfo.version;\n\t\tthis.name     = DeviceInfo.name;\n\t\tthis.phonegap = DeviceInfo.gap;\n\t\tthis.uuid     = DeviceInfo.uuid;\n\n    } \n\tcatch(e) \n\t{\n        // TODO: \n    }\n\tthis.available = PhoneGap.available = this.uuid != null;\n}\n\nPhoneGap.addConstructor(function() {\n\tif (typeof navigator.device === "undefined") {\n    \tnavigator.device = window.device = new Device();\n\t}\n});\n};\nif (!PhoneGap.hasResource("file")) {\n\tPhoneGap.addResource("file");\n\n/**\n * This class provides generic read and write access to the mobile device file system.\n * They are not used to read files from a server.\n */\n\n/**\n * This class provides some useful information about a file.\n * This is the fields returned when navigator.fileMgr.getFileProperties() \n * is called.\n */\nFileProperties = function(filePath) {\n    this.filePath = filePath;\n    this.size = 0;\n    this.lastModifiedDate = null;\n}\n/**\n * Represents a single file.\n * \n * name {DOMString} name of the file, without path information\n * fullPath {DOMString} the full path of the file, including the name\n * type {DOMString} mime type\n * lastModifiedDate {Date} last modified date\n * size {Number} size of the file in bytes\n */\nFile = function(name, fullPath, type, lastModifiedDate, size) {\n\tthis.name = name || null;\n    this.fullPath = fullPath || null;\n\tthis.type = type || null;\n    this.lastModifiedDate = lastModifiedDate || null;\n    this.size = size || 0;\n}\n/**\n * Create an event object since we can\'t set target on DOM event.\n *\n * @param type\n * @param target\n *\n */\nFile._createEvent = function(type, target) {\n    // Can\'t create event object, since we can\'t set target (its readonly)\n    //var evt = document.createEvent(\'Events\');\n    //evt.initEvent("onload", false, false);\n    var evt = {"type": type};\n    evt.target = target;\n    return evt;\n};\n\nFileError = function() {\n   this.code = null;\n}\n\n// File error codes\n// Found in DOMException\nFileError.NOT_FOUND_ERR = 1;\nFileError.SECURITY_ERR = 2;\nFileError.ABORT_ERR = 3;\n\n// Added by this specification\nFileError.NOT_READABLE_ERR = 4;\nFileError.ENCODING_ERR = 5;\nFileError.NO_MODIFICATION_ALLOWED_ERR = 6;\nFileError.INVALID_STATE_ERR = 7;\nFileError.SYNTAX_ERR = 8;\nFileError.INVALID_MODIFICATION_ERR = 9;\nFileError.QUOTA_EXCEEDED_ERR = 10;\nFileError.TYPE_MISMATCH_ERR = 11;\nFileError.PATH_EXISTS_ERR = 12;\n\n//-----------------------------------------------------------------------------\n// File manager\n//-----------------------------------------------------------------------------\n\nFileMgr = function() {\n}\n\nFileMgr.prototype.testFileExists = function(fileName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "testFileExists", [fileName]);\n};\n\nFileMgr.prototype.testDirectoryExists = function(dirName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "testDirectoryExists", [dirName]);\n};\n\nFileMgr.prototype.getFreeDiskSpace = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getFreeDiskSpace", []);\n};\n\nFileMgr.prototype.writeAsText = function(fileName, data, bAppend, successCallback, errorCallback)';b.b.b+=' {\n    PhoneGap.exec(successCallback, errorCallback, "File", "write", [fileName, data, bAppend ? 1 : 0]);\n};\n\nFileMgr.prototype.write = function(fileName, data, position, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "write", [fileName, data, position]);\n};\n\nFileMgr.prototype.truncate = function(fileName, size, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "truncateFile", [fileName, size]);\n};\n\nFileMgr.prototype.readAsText = function(fileName, encoding, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "readFile", [fileName, encoding]);\n};\n\nFileMgr.prototype.readAsDataURL = function(fileName, successCallback, errorCallback) {\n\tPhoneGap.exec(successCallback, errorCallback, "File", "readAsDataURL", [fileName]);\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.fileMgr === "undefined") {\n        navigator.fileMgr = new FileMgr();\n    }\n});\n\n\n//-----------------------------------------------------------------------------\n// File Reader\n//-----------------------------------------------------------------------------\n\n/**\n * This class reads the mobile device file system.\n *\n */\nFileReader = function() {\n    this.fileName = "";\n\n    this.readyState = 0;\n\n    // File data\n    this.result = null;\n\n    // Error\n    this.error = null;\n\n    // Event handlers\n    this.onloadstart = null;    // When the read starts.\n    this.onprogress = null;     // While reading (and decoding) file or fileBlob data, and reporting partial file data (progess.loaded/progress.total)\n    this.onload = null;         // When the read has successfully completed.\n    this.onerror = null;        // When the read has failed (see errors).\n    this.onloadend = null;      // When the request has completed (either in success or failure).\n    this.onabort = null;        // When the read has been aborted. For instance, by invoking the abort() method.\n}\n\n// States\nFileReader.EMPTY = 0;\nFileReader.LOADING = 1;\nFileReader.DONE = 2;\n\n/**\n * Abort reading file.\n */\nFileReader.prototype.abort = function() {\n    var evt;\n    this.readyState = FileReader.DONE;\n    this.result = null;\n\n    // set error\n    var error = new FileError();\n    error.code = error.ABORT_ERR;\n    this.error = error;\n   \n    // If error callback\n    if (typeof this.onerror === "function") {\n        evt = File._createEvent("error", this);\n        this.onerror(evt);\n    }\n    // If abort callback\n    if (typeof this.onabort === "function") {\n        evt = File._createEvent("abort", this);\n        this.onabort(evt);\n    }\n    // If load end callback\n    if (typeof this.onloadend === "function") {\n        evt = File._createEvent("loadend", this);\n        this.onloadend(evt);\n    }\n};\n\n/**\n * Read text file.\n *\n * @param file          The name of the file\n * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)\n */\nFileReader.prototype.readAsText = function(file, encoding) {\n    this.fileName = "";\n\tif (typeof file.fullPath === "undefined") {\n\t\tthis.fileName = file;\n\t} else {\n\t\tthis.fileName = file.fullPath;\n\t}\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === "function") {\n        var evt = File._createEvent("loadstart", this);\n        this.onloadstart(evt);\n    }\n\n    // Default encoding is UTF-8\n    var enc = encoding ? encoding : "UTF-8";\n\n    var me = this;\n\n    // Read file\n    navigator.fileMgr.readAsText(this.fileName, enc,\n\n        // Success callback\n        function(r) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = decodeURIComponent(r);\n\n            // If onload callback\n            if (typeof me.onload === "function") {\n                evt = File._createEvent("load", me);\n                me.onload(evt);\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                evt = File._createEvent("loadend", me);\n                me.onloadend(evt);\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                evt = File._createEvent("error", me);\n                me.onerror(evt);\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                evt = File._createEvent("loadend", me);\n                me.onloadend(evt);\n            }\n        }\n        );\n};\n\n\n/**\n * Read file and return data as a base64 encoded data url.\n * A data url is of the form:\n *      data:[<mediatype>][;base64],<data>\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsDataURL = function(file) {\n    this.fileName = "";\n    \n    if (typeof file.fullPath === "undefined") {\n        this.fileName = file;\n    } else {\n        this.fileName = file.fullPath;\n    }\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === "function") {\n        var evt = File._createEvent("loadstart", this);\n        this.onloadstart(evt);\n    }\n\n    var me = this;\n\n    // Read file\n    navigator.fileMgr.readAsDataURL(this.fileName,\n\n        // Success callback\n        function(r) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = r;\n\n            // If onload callback\n            if (typeof me.onload === "function") {\n                evt = File._createEvent("load", me);\n                me.onload(evt);\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                evt = File._createEvent("loadend", me);\n                me.onloadend(evt);\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                evt = File._createEvent("error", me);\n                me.onerror(evt);\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === "function") {\n                evt = File._createEvent("loadend", me);\n                me.onloadend(evt);\n            }\n        }\n        );\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          The name of the file\n */\nFileReader.prototype.readAsBinaryString = function(file) {\n    // TODO - Can\'t return binary data to browser.\n    this.fileName = file;\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          The name of the file\n */\nFileReader.prototype.readAsArrayBuffer = function(file) {\n    // TODO - Can\'t return binary data to browser.\n    this.fileName = file;\n};\n\n//-----------------------------------------------------------------------------\n// File Writer\n//-----------------------------------------------------------------------------\n\n/**\n * This class writes to the mobile device file system.\n *\n  @param file {File} a File object representing a file on the file system\n*/\nFileWriter = function(file) {\n    this.fileName = "";\n    this.length = 0;\n\tif (file) {\n\t    this.fileName = file.fullPath || file;\n\t    this.length = file.size || 0;\n\t}\n\t\n\t// default is to write at the beginning of the file\n    this.position = 0;\n    \n    this.readyState = 0; // EMPTY\n\n    this.result = null;\n\n    // Error\n    this.error = null;\n\n    // Event handlers\n    this.onwritestart = null;\t// When writing starts\n    this.onprogress = null;\t\t// While writing the file, and reporting partial file data\n    this.onwrite = null;\t\t// When the write has successfully completed.\n    this.onwriteend = null;\t\t// When the request has completed (either in success or failure).\n    this.onabort = null;\t\t// When the write has been aborted. For instance, by invoking the abort() method.\n    this.onerror = null;\t\t// When the write has failed (see errors).\n}\n\n// States\nFileWriter.INIT = 0;\nFileWriter.WRITING = 1;\nFileWriter.DONE = 2;\n\n/**\n * Abort writing file.\n */\nFileWriter.prototype.abort = function() {\n    // check for invalid state\n\tif (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t} \n\n    // set error\n    var error = new FileError(), evt;\n    error.code = error.ABORT_ERR;\n    this.error = error;\n    \n    // If error callback\n    if (typeof this.onerror === "function") {\n        evt = File._createEvent("error", this);\n        this.onerror(evt);\n    }\n    // If abort callback\n    if (typeof this.onabort === "function") {\n        evt = File._createEvent("abort", this);\n        this.onabort(evt);\n    }\n    \n    this.readyState = FileWriter.DONE;\n\n    // If write end callback\n    if (typeof this.onwriteend == "function") {\n        evt = File._createEvent("writeend", this);\n        this.onwriteend(evt);\n    }\n};\n\n/**\n * @Deprecated: use write instead\n * \n * @param file to write the data to\n * @param text to be written\n * @param bAppend if true write to end of file, otherwise overwrite the file\n */\nFileWriter.prototype.writeAsText = function(file, text, bAppend) {\n\t// Throw an exception if we are already writing a file\n\tif (this.readyState === FileWriter.WRITING) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\n\tif (bAppend !== true) {\n        bAppend = false; // for null values\n    }\n\n    this.fileName = file;\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === "function") {\n        var evt = File._createEvent("writestart", me);\n        me.onwritestart(evt);\n    }\n\t\n\t\n    // Write file \n\tnavigator.fileMgr.writeAsText(file, text, bAppend,\n        // Success callback\n        function(r) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = r;\n\n            // If onwrite callback\n            if (typeof me.onwrite === "function") {\n                evt = File._createEvent("write", me);\n                me.onwrite(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                evt = File._createEvent("error", me);\n                me.onerror(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        }\n    );\n};\n\n/**\n * Writes data to the file\n *  \n * @param text to be written\n */\nFileWriter.prototype.write = function(text) {\n\t// Throw an exception if we are already writing a file\n\tif (this.readyState === FileWriter.WRITING) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === "function") {\n        var evt = File._createEvent("writestart", me);\n        me.onwritestart(evt);\n    }\n\n    // Write file\n    navigator.fileMgr.write(this.fileName, text, this.position,\n\n        // Success callback\n        function(r) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            \n            // position always increases by bytes written because file would be extended\n            me.position += r;\n\t\t\t// The length of the file is now where we are done writing.\n\t\t\tme.length = me.position;\n            \n            // If onwrite callback\n            if (typeof me.onwrite === "function") {\n                evt = File._createEvent("write", me);\n                me.onwrite(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                evt = File._createEvent("error", me);\n                me.onerror(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        }\n        );\n\n};\n\n/** \n * Moves the file pointer to the location specified.\n * \n * If the offset is a negative number the position of the file \n * pointer is rewound.  If the offset is greater than the file \n * size the position is set to the end of the file.  \n * \n * @param offset is the location to move the file pointer to.\n */\nFileWriter.prototype.seek = function(offset) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw FileError.INVALID_STATE_ERR;\n    }\n\n    if (!offset) {\n        return;\n    }\n    \n    // See back from end of file.\n    if (offset < 0) {\n\t\tthis.position = Math.max(offset + this.length, 0);\n\t}\n    // Offset is bigger then file size so set position \n    // to the end of the file.\n\telse if (offset > this.length) {\n\t\tthis.position = this.length;\n\t}\n    // Offset is between 0 and file size so set the position\n    // to start writing.\n\telse {\n\t\tthis.position = offset;\n\t}\t\n};\n\n/** \n * Truncates the file to the size specified.\n * \n * @param size to chop the file at.\n */\nFileWriter.prototype.truncate = function(size) {\n\t// Throw an exception if we are already writing a file\n\tif (this.readyState === FileWriter.WRITING) {\n\t\tthrow FileError.INVALID_STATE_ERR;\n\t}\n\t// what if no size specified? \n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === "function") {\n        var evt = File._createEvent("writestart", me);\n        me.onwritestart(evt);\n    }\n\n    // Write file\n    navigator.fileMgr.truncate(this.fileName, size,\n\n        // Success callback\n        function(r) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n              ';b.b.b+='  return;\n            }\n\n            // Update the length of the file\n            me.length = r;\n            me.position = Math.min(me.position, r);\n\n            // If onwrite callback\n            if (typeof me.onwrite === "function") {\n                evt = File._createEvent("write", me);\n                me.onwrite(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        },\n\n        // Error callback\n        function(e) {\n            var evt;\n            // If DONE (cancelled), then don\'t do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // Save error\n            me.error = e;\n\n            // If onerror callback\n            if (typeof me.onerror === "function") {\n                evt = File._createEvent("error", me);\n                me.onerror(evt);\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === "function") {\n                evt = File._createEvent("writeend", me);\n                me.onwriteend(evt);\n            }\n        }\n    );\n};\n\nLocalFileSystem = function() {\n};\n\n// File error codes\nLocalFileSystem.TEMPORARY = 0;\nLocalFileSystem.PERSISTENT = 1;\nLocalFileSystem.RESOURCE = 2;\nLocalFileSystem.APPLICATION = 3;\n\n/**\n * Requests a filesystem in which to store application data.\n * \n * @param {int} type of file system being requested\n * @param {Function} successCallback is called with the new FileSystem\n * @param {Function} errorCallback is called with a FileError\n */\nLocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) {\n\tif (type < 0 || type > 3) {\n\t\tif (typeof errorCallback == "function") {\n\t\t\terrorCallback({\n\t\t\t\t"code": FileError.SYNTAX_ERR\n\t\t\t});\n\t\t}\n\t}\n\telse {\n\t\tPhoneGap.exec(successCallback, errorCallback, "File", "requestFileSystem", [type, size]);\n\t}\n};\n\n/**\n * \n * @param {DOMString} uri referring to a local file in a filesystem\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nLocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "resolveLocalFileSystemURI", [uri]);\n};\n\n/**\n* This function  is required as we need to convert raw \n* JSON objects into concrete File and Directory objects.  \n* \n* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects.\n* @returns an entry \n*/\nLocalFileSystem.prototype._castFS = function(pluginResult) {\n    var entry = null;\n    entry = new DirectoryEntry();\n    entry.isDirectory = pluginResult.message.root.isDirectory;\n    entry.isFile = pluginResult.message.root.isFile;\n    entry.name = pluginResult.message.root.name;\n    entry.fullPath = pluginResult.message.root.fullPath;\n    pluginResult.message.root = entry;\n    return pluginResult;    \n}\n\nLocalFileSystem.prototype._castEntry = function(pluginResult) {\n    var entry = null;\n    if (pluginResult.message.isDirectory) {\n        entry = new DirectoryEntry();\n    }\n    else if (pluginResult.message.isFile) {\n\t\tentry = new FileEntry();\n    }\n    entry.isDirectory = pluginResult.message.isDirectory;\n    entry.isFile = pluginResult.message.isFile;\n    entry.name = pluginResult.message.name;\n    entry.fullPath = pluginResult.message.fullPath;\n    pluginResult.message = entry;\n    return pluginResult;    \n}\n\nLocalFileSystem.prototype._castEntries = function(pluginResult) {\n    var entries = pluginResult.message;\n\tvar retVal = []; \n\tfor (i=0; i<entries.length; i++) {\n\t\tretVal.push(window.localFileSystem._createEntry(entries[i]));\n\t}\n    pluginResult.message = retVal;\n    return pluginResult;    \n}\n\nLocalFileSystem.prototype._createEntry = function(castMe) {\n\tvar entry = null;\n    if (castMe.isDirectory) {\n        entry = new DirectoryEntry();\n    }\n    else if (castMe.isFile) {\n        entry = new FileEntry();\n    }\n    entry.isDirectory = castMe.isDirectory;\n    entry.isFile = castMe.isFile;\n    entry.name = castMe.name;\n    entry.fullPath = castMe.fullPath;\n    return entry;    \n\n}\n\nLocalFileSystem.prototype._castDate = function(pluginResult) {\n\tif (pluginResult.message.modificationTime) {\n\t\tvar metadataObj = new Metadata();\n\t\t\n\t    metadataObj.modificationTime = new Date(pluginResult.message.modificationTime);\n\t    pluginResult.message = metadataObj;\n\t}\n\telse if (pluginResult.message.lastModifiedDate) {\n\t\tvar file = new File();\n        file.size = pluginResult.message.size;\n        file.type = pluginResult.message.type;\n        file.name = pluginResult.message.name;\n        file.fullPath = pluginResult.message.fullPath;\n\t\tfile.lastModifiedDate = new Date(pluginResult.message.lastModifiedDate);\n\t    pluginResult.message = file;\t\t\n\t}\n\n    return pluginResult;\t\n}\nLocalFileSystem.prototype._castError = function(pluginResult) {\n\tvar fileError = new FileError();\n\tfileError.code = pluginResult.message;\n\tpluginResult.message = fileError;\n\treturn pluginResult;\n}\n\n/**\n * Information about the state of the file or directory\n * \n * {Date} modificationTime (readonly)\n */\nMetadata = function() {\n    this.modificationTime=null;\n};\n\n/**\n * Supplies arguments to methods that lookup or create files and directories\n * \n * @param {boolean} create file or directory if it doesn\'t exist \n * @param {boolean} exclusive if true the command will fail if the file or directory exists\n */\nFlags = function(create, exclusive) {\n    this.create = create || false;\n    this.exclusive = exclusive || false;\n};\n\n/**\n * An interface representing a file system\n * \n * {DOMString} name the unique name of the file system (readonly)\n * {DirectoryEntry} root directory of the file system (readonly)\n */\nFileSystem = function() {\n    this.name = null;\n    this.root = null;\n};\n\n/**\n * An interface representing a directory on the file system.\n * \n * {boolean} isFile always false (readonly)\n * {boolean} isDirectory always true (readonly)\n * {DOMString} name of the directory, excluding the path leading to it (readonly)\n * {DOMString} fullPath the absolute full path to the directory (readonly)\n * {FileSystem} filesystem on which the directory resides (readonly)\n */\nDirectoryEntry = function() {\n    this.isFile = false;\n    this.isDirectory = true;\n    this.name = null;\n    this.fullPath = null;\n    this.filesystem = null;\n};\n\n/**\n * Copies a directory to a new location\n * \n * @param {DirectoryEntry} parent the directory to which to copy the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Looks up the metadata of the entry\n * \n * @param {Function} successCallback is called with a Metadata object\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getMetadata = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]);\n};\n\n/**\n * Gets the parent of the entry\n * \n * @param {Function} successCallback is called with a parent entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getParent = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]);\n};\n\n/**\n * Moves a directory to a new location\n * \n * @param {DirectoryEntry} parent the directory to which to move the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Removes the entry\n * \n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.remove = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]);\n};\n\n/**\n * Returns a URI that can be used to identify this entry.\n * \n * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.toURI = function(mimeType, successCallback, errorCallback) {\n    return "file://localhost" + this.fullPath;\n    //PhoneGap.exec(successCallback, errorCallback, "File", "toURI", [this.fullPath, mimeType]);\n};\n\n/**\n * Creates a new DirectoryReader to read entries from this directory\n */\nDirectoryEntry.prototype.createReader = function(successCallback, errorCallback) {\n    return new DirectoryReader(this.fullPath);\n};\n\n/**\n * Creates or looks up a directory\n * \n * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory\n * @param {Flags} options to create or excluively create the directory\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getDirectory", [this.fullPath, path, options]);\n};\n\n/**\n * Creates or looks up a file\n * \n * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file\n * @param {Flags} options to create or excluively create the file\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getFile", [this.fullPath, path, options]);\n};\n\n/**\n * Deletes a directory and all of it\'s contents\n * \n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "removeRecursively", [this.fullPath]);\n};\n\n/**\n * An interface that lists the files and directories in a directory.\n */\nDirectoryReader = function(fullPath){\n\tthis.fullPath = fullPath || null;    \n};\n\n/**\n * Returns a list of entries from a directory.\n * \n * @param {Function} successCallback is called with a list of entries\n * @param {Function} errorCallback is called with a FileError\n */\nDirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "readEntries", [this.fullPath]);\n}\n \n/**\n * An interface representing a directory on the file system.\n * \n * {boolean} isFile always true (readonly)\n * {boolean} isDirectory always false (readonly)\n * {DOMString} name of the file, excluding the path leading to it (readonly)\n * {DOMString} fullPath the absolute full path to the file (readonly)\n * {FileSystem} filesystem on which the directory resides (readonly)\n */\nFileEntry = function() {\n    this.isFile = true;\n    this.isDirectory = false;\n    this.name = null;\n    this.fullPath = null;\n    this.filesystem = null;\n};\n\n/**\n * Copies a file to a new location\n * \n * @param {DirectoryEntry} parent the directory to which to copy the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Looks up the metadata of the entry\n * \n * @param {Function} successCallback is called with a Metadata object\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.getMetadata = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]);\n};\n\n/**\n * Gets the parent of the entry\n * \n * @param {Function} successCallback is called with a parent entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.getParent = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]);\n};\n\n/**\n * Moves a directory to a new location\n * \n * @param {DirectoryEntry} parent the directory to which to move the entry\n * @param {DOMString} newName the new name of the entry, defaults to the current name\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]);\n};\n\n/**\n * Removes the entry\n * \n * @param {Function} successCallback is called with no parameters\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.remove = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]);\n};\n\n/**\n * Returns a URI that can be used to identify this entry.\n * \n * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.\n * @param {Function} successCallback is called with the new entry\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.toURI = function(mimeType, successCallback, errorCallback) {\n    return "file://localhost" + this.fullPath;\n    //PhoneGap.exec(successCallback, errorCallback, "File", "toURI", [this.fullPath, mimeType]);\n};\n\n/**\n * Creates a new FileWriter associated with the file that this FileEntry represents.\n * \n * @param {Function} successCallback is called with the new FileWriter\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.createWriter = function(successCallback, errorCallback) {\n\tthis.file(function(filePointer) {\t\n\t\tvar writer = new FileWriter(filePointer);\n\t\tif (writer.fileName == null || writer.fileName == "") {\n\t\t\tif (typeof errorCallback == "function") {\n\t\t\t\terrorCallback({\n\t\t\t\t\t"code": FileError.INVALID_STATE_ERR\n\t\t\t\t});\n\t\t}\n\t\t}\n\t\tif (typeof successCallback == "function") {\n\t\t\tsuccessCallback(writer);\n\t\t}       \n\t}, errorCallback);\n};\n\n/**\n * Returns a File that represents the current state of the file that this FileEntry represents.\n * \n * @param {Function} successCallback is called with the new File object\n * @param {Function} errorCallback is called with a FileError\n */\nFileEntry.prototype.file = function(successCallback, errorCallback) {\n    PhoneGap.exec(successCallback, errorCallback, "File", "getFileMetadata", [this.fullPath]);\n};\n\n/**\n * Add the FileSystem interface into the browser.\n */\nPhoneGap.addConstructor(function() {\n\tvar pgLocalFileSystem = new LocalFileSystem();\n\t// Needed for cast methods\n    if(typeof window.localFileSystem == "undefined") window.localFileSystem  = pgLocalFileSystem;\n    if(typeof window.requestFileSystem == "undefined") window.requestFileSystem  = pgLocalFileSystem.requestFileSystem;\n    if(typeof window.resolveLocalFileSystemURI == "undefined") window.resolveLocalFileSystemURI = pgLocalFileSystem.resolveLocalFileSystemURI';b.b.b+=';\n});\n};\n\n\n\n\n/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.\n *  \n * Copyright (c) 2005-2011, Nitobi Software Inc.\n * Copyright (c) 2011, Matt Kane\n */\n\nif (!PhoneGap.hasResource("filetransfer")) {\n\tPhoneGap.addResource("filetransfer");\n\n/**\n * FileTransfer uploads a file to a remote server.\n */\nFileTransfer = function() {}\n\n/**\n * FileUploadResult\n */\nFileUploadResult = function() {\n    this.bytesSent = 0;\n    this.responseCode = null;\n    this.response = null;\n}\n\n/**\n * FileTransferError\n */\nFileTransferError = function(errorCode) {\n    this.code = errorCode || null;\n}\n\nFileTransferError.FILE_NOT_FOUND_ERR = 1;\nFileTransferError.INVALID_URL_ERR = 2;\nFileTransferError.CONNECTION_ERR = 3;\n\n/**\n* Given an absolute file path, uploads a file on the device to a remote server \n* using a multipart HTTP request.\n* @param filePath {String}           Full path of the file on the device\n* @param server {String}             URL of the server to receive the file\n* @param successCallback (Function}  Callback to be invoked when upload has completed\n* @param errorCallback {Function}    Callback to be invoked upon error\n* @param options {FileUploadOptions} Optional parameters such as file name and mimetype           \n*/\nFileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options) {\n\tif(!options.params) {\n\t\toptions.params = {};\n\t}\n\toptions.filePath = filePath;\n\toptions.server = server;\n\tif(!options.fileKey) {\n\t\toptions.fileKey = \'file\';\n\t}\n\tif(!options.fileName) {\n\t\toptions.fileName = \'image.jpg\';\n\t}\n\tif(!options.mimeType) {\n\t\toptions.mimeType = \'image/jpeg\';\n\t}\n\t\n\t// successCallback required\n\tif (typeof successCallback != "function") {\n        console.log("FileTransfer Error: successCallback is not a function");\n        return;\n    }\n\n\n    // errorCallback optional\n    if (errorCallback && (typeof errorCallback != "function")) {\n        console.log("FileTransfer Error: errorCallback is not a function");\n        return;\n    }\n\t\n    PhoneGap.exec(successCallback, errorCallback, \'FileTransfer\', \'upload\', [options]);\n};\n\nFileTransfer.prototype._castTransferError = function(pluginResult) {\n\tvar fileError = new FileTransferError(pluginResult.message);\n\t//fileError.code = pluginResult.message;\n\tpluginResult.message = fileError;\n\treturn pluginResult;\n}\n\nFileTransfer.prototype._castUploadResult = function(pluginResult) {\n\tvar result = new FileUploadResult();\n\tresult.bytesSent = pluginResult.message.bytesSent;\n\tresult.responseCode = pluginResult.message.responseCode;\n\tresult.response = decodeURIComponent(pluginResult.message.response);\n\tpluginResult.message = result;\n\treturn pluginResult;\n}\n\n/**\n * Options to customize the HTTP request used to upload files.\n * @param fileKey {String}   Name of file request parameter.\n * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.\n * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.\n * @param params {Object}    Object with key: value params to send to the server.\n */\nFileUploadOptions = function(fileKey, fileName, mimeType, params) {\n    this.fileKey = fileKey || null;\n    this.fileName = fileName || null;\n    this.mimeType = mimeType || null;\n    this.params = params || null;\n}\n\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.fileTransfer == "undefined") navigator.fileTransfer = new FileTransfer();\n});\n};\nif (!PhoneGap.hasResource("geolocation")) {\n\tPhoneGap.addResource("geolocation");\n\n/**\n * This class provides access to device GPS data.\n * @constructor\n */\nGeolocation = function() {\n    // The last known GPS position.\n    this.lastPosition = null;\n    this.listener = null;\n    this.timeoutTimerId = 0;\n\n};\n\n\n/**\n * Asynchronously aquires the current position.\n * @param {Function} successCallback The function to call when the position\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the position data.\n * @param {PositionOptions} options The options for getting the position data\n * such as timeout.\n * PositionOptions.forcePrompt:Bool default false, \n * - tells iPhone to prompt the user to turn on location services.\n * - may cause your app to exit while the user is sent to the Settings app\n * PositionOptions.distanceFilter:double aka Number\n * - used to represent a distance in meters.\nPositionOptions\n{\n   desiredAccuracy:Number\n   - a distance in meters \n\t\t< 10   = best accuracy  ( Default value )\n\t\t< 100  = Nearest Ten Meters\n\t\t< 1000 = Nearest Hundred Meters\n\t\t< 3000 = Accuracy Kilometers\n\t\t3000+  = Accuracy 3 Kilometers\n\t\t\n\tforcePrompt:Boolean default false ( iPhone Only! )\n    - tells iPhone to prompt the user to turn on location services.\n\t- may cause your app to exit while the user is sent to the Settings app\n\t\n\tdistanceFilter:Number\n\t- The minimum distance (measured in meters) a device must move laterally before an update event is generated.\n\t- measured relative to the previously delivered location\n\t- default value: null ( all movements will be reported )\n\t\n}\n\n */\n \nGeolocation.prototype.getCurrentPosition = function(successCallback, errorCallback, options) \n{\n    // if (this.listener != null) \n    // {\n    //     console.log("Geolocation Error: Still waiting for previous getCurrentPosition() request.");\n    //     if (errorCallback && typeof(errorCallback) == \'function\')\n    //     {\n    //         errorCallback(new PositionError(PositionError.TIMEOUT, "Geolocation Error: Still waiting for previous getCurrentPosition() request."));\n    //     } \n    //     return PositionError.TIMEOUT;\n    // }\n    \n    // create an always valid local success callback\n    var win = successCallback;\n    if (!win || typeof(win) != \'function\')\n    {\n        win = function(position) {};\n    }\n    \n    // create an always valid local error callback\n    var fail = errorCallback;\n    if (!fail || typeof(fail) != \'function\')\n    {\n        fail = function(positionError) {};\n    }\t\n\n    var self = this;\n    var totalTime = 0;\n\tvar timeoutTimerId;\n\t\n\t// set params to our default values\n\tvar params = new PositionOptions();\n\t\n    if (options) \n    {\n        if (options.maximumAge) \n        {\n            // special case here if we have a cached value that is younger than maximumAge\n            if(this.lastPosition)\n            {\n                var now = new Date().getTime();\n                if(now - this.lastPosition.timestamp < options.maximumAge)\n                {\n                    win(this.lastPosition); // send cached position immediately \n                    return;                 // Note, execution stops here -jm\n                }\n            }\n            params.maximumAge = options.maximumAge;\n        }\n        if (options.enableHighAccuracy) \n        {\n            params.enableHighAccuracy = (options.enableHighAccuracy == true); // make sure it\'s truthy\n        }\n        if (options.timeout) \n        {\n            params.timeout = options.timeout;\n        }\n    }\n    \n    this.listener = {"success":win,"fail":fail};\n    this.start(params);\n\t\n\tvar onTimeout = function()\n\t{\n\t    self.setError(new PositionError(PositionError.TIMEOUT,"Geolocation Error: Timeout."));\n\t};\n\t \n    this.timeoutTimerId = setTimeout(onTimeout, params.timeout); \n};\n\n/**\n * Asynchronously aquires the position repeatedly at a given interval.\n * @param {Function} successCallback The function to call each time the position\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the position data.\n * @param {PositionOptions} options The options for getting the position data\n * such as timeout and the frequency of the watch.\n */\nGeolocation.prototype.watchPosition = function(successCallback, errorCallback, options) {\n\t// Invoke the appropriate callback with a new Position object every time the implementation \n\t// determines that the position of the hosting device has changed. \n\n\tvar self = this; // those == this & that\n\t\n\tvar params = new PositionOptions();\n\n    if(options)\n    {\n        if (options.maximumAge) {\n            params.maximumAge = options.maximumAge;\n        }\n        if (options.enableHighAccuracy) {\n            params.enableHighAccuracy = options.enableHighAccuracy;\n        }\n        if (options.timeout) {\n            params.timeout = options.timeout;\n        }\n    }\n\n\tvar that = this;\n    var lastPos = that.lastPosition? that.lastPosition.clone() : null;\n    \n\treturn setInterval(function() \n\t{\n        var filterFun = function(position) {\n            if (lastPos == null || !position.equals(lastPos)) {\n                // only call the success callback when there is a change in position, per W3C\n                successCallback(position);\n            }\n            \n            // clone the new position, save it as our last position (internal var)\n            lastPos = position.clone();\n        };\n\t\tthat.getCurrentPosition(filterFun, errorCallback, params);\n\t}, params.timeout);\n};\n\n\n/**\n * Clears the specified position watch.\n * @param {String} watchId The ID of the watch returned from #watchPosition.\n */\nGeolocation.prototype.clearWatch = function(watchId) {\n\tclearInterval(watchId);\n};\n\n/**\n * Called by the geolocation framework when the current location is found.\n * @param {PositionOptions} position The current position.\n */\nGeolocation.prototype.setLocation = function(position) \n{\n    var _position = new Position(position.coords, position.timestamp);\n\n    if(this.timeoutTimerId)\n    {\n        clearTimeout(this.timeoutTimerId);\n        this.timeoutTimerId = 0;\n    }\n    \n\tthis.lastError = null;\n    this.lastPosition = _position;\n    \n    if(this.listener && typeof(this.listener.success) == \'function\')\n    {\n        this.listener.success(_position);\n    }\n    \n    this.listener = null;\n};\n\n/**\n * Called by the geolocation framework when an error occurs while looking up the current position.\n * @param {String} message The text of the error message.\n */\nGeolocation.prototype.setError = function(error) \n{\n\tvar _error = new PositionError(error.code, error.message);\n\t\n    if(this.timeoutTimerId)\n    {\n        clearTimeout(this.timeoutTimerId);\n        this.timeoutTimerId = 0;\n    }\n    \n    this.lastError = _error;\n    // call error handlers directly\n    if(this.listener && typeof(this.listener.fail) == \'function\')\n    {\n        this.listener.fail(_error);\n    }\n    this.listener = null;\n\n};\n\nGeolocation.prototype.start = function(args) \n{\n    PhoneGap.exec("Location.startLocation", args);\n};\n\nGeolocation.prototype.stop = function() \n{\n    PhoneGap.exec("Location.stopLocation");\n};\n\n\nPhoneGap.addConstructor(function() \n{\n    if (typeof navigator._geo == "undefined") \n    {\n        // replace origObj\'s functions ( listed in funkList ) with the same method name on proxyObj\n        // this is a workaround to prevent UIWebView/MobileSafari default implementation of GeoLocation\n        // because it includes the full page path as the title of the alert prompt\n        var __proxyObj = function (origObj,proxyObj,funkList)\n        {\n            var replaceFunk = function(org,proxy,fName)\n            { \n                org[fName] = function()\n                { \n                   return proxy[fName].apply(proxy,arguments); \n                }; \n            };\n\n            for(var v in funkList) { replaceFunk(origObj,proxyObj,funkList[v]);}\n        }\n        navigator._geo = new Geolocation();\n        __proxyObj(navigator.geolocation, navigator._geo,\n                 ["setLocation","getCurrentPosition","watchPosition",\n                  "clearWatch","setError","start","stop"]);\n\n    }\n\n});\n};\nif (!PhoneGap.hasResource("compass")) {\n\tPhoneGap.addResource("compass");\n\t\n/**\n * This class provides access to device Compass data.\n * @constructor\n */\nCompass = function() {\n    /**\n     * The last known Compass position.\n     */\n    // lastHeading actually contains a bit more info than what we return to our callbacks \n    // timestamp, magneticHeading, trueHeading, headingAccuracy, x, y, z\n    // docs specify that the return value is a simple \'heading\'\n    // if possible we will use trueHeading, otherwise magneticHeading is returned\n    // trueHeading is only available if location services is ON\n\tthis.lastHeading = null;\n    this.lastError = null;\n\tthis.callbacks = {\n\t\tonHeadingChanged: [],\n        onError:           []\n    };\n};\n\n/**\n * Asynchronously aquires the current heading.\n * @param {Function} successCallback The function to call when the heading\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the heading data.\n * @param {PositionOptions} options The options for getting the heading data\n * such as timeout.\n */\nCompass.prototype.getCurrentHeading = function(successCallback, errorCallback, options) {\n\tif (this.lastHeading == null) {\n        this.callbacks.onHeadingChanged.push(successCallback);\n        this.callbacks.onError.push(errorCallback);\n\t\tthis.start(options);\n\t}\n\telse\n\t{\n\t    if(options.maximumAge)\n        {\n            var now = new Date().getTime();\n            if(now - this.lastHeading.timestamp > options.maximumAge)\n            {\n                this.callbacks.onHeadingChanged.push(successCallback);\n                this.callbacks.onError.push(errorCallback);\n                \n                this.start(options); // we have a cached value that is old ...\n                return;\n            }\n        } \n\n        // we have a last heading + it is NOT older than maximumAge, or maximumAge is not specified\n        if (typeof successCallback == "function") \n    \t{\n    \t    var returnHeading = -1;\n    \t    if(this.lastHeading.trueHeading > -1)\n    \t    {\n    \t        returnHeading = this.lastHeading.trueHeading;\n    \t    }\n    \t    else if( this.lastHeading.magneticHeading )\n    \t    {\n    \t        returnHeading = this.lastHeading.magneticHeading;\n    \t    }\n    \t\tsuccessCallback(returnHeading);\n    \t}\n\t}\n\t\n};\n\n/**\n * Asynchronously aquires the heading repeatedly at a given interval.\n * @param {Function} successCallback The function to call each time the heading\n * data is available\n * @param {Function} errorCallback The function to call when there is an error \n * getting the heading data.\n * @param {HeadingOptions} options The options for getting the heading data\n * such as timeout and the frequency of the watch.\n */\nCompass.prototype.watchHeading= function(successCallback, errorCallback, options) \n{\n\t// Invoke the appropriate callback with a new Position object every time the implementation \n\t// determines that the position of the hosting device has changed. \n\t\n\tvar frequency = (options && options.frequency) ? options.frequency : 1000;\n\tvar self = this;\n\tvar funk = function() \n\t{\n\t\tself.getCurrentHeading(successCallback, errorCallback, options);\n\t};\n\tfunk();\n\treturn setInterval(funk, frequency);\n};\n\n\n/**\n * Clears the specified heading watch.\n * @param {String} watchId The ID of the watch returned from #watchHeading.\n */\nCompass.prototype.clearWatch = function(watchId) \n{\n\tclearInterval(watchId);\n};\n\n\n/**\n * Called by the geolocation framework when the current heading is found.\n * @param {heading} heading The current heading.\n */\nCompass.prototype.setHeading = function(heading) \n{\n    this.lastHeading = heading;\n    // the last heading we are storing has lots more info, but the current API docs only state that \n    // the direction value is returned.\n    var returnHeading = -1;\n    if(this.lastHeading.trueHeading > -1)\n    {\n        returnHeading = this.lastHeading.trueHeading;\n    }\n    else if( this.lastHeading.magneticHeading )\n    {\n        returnHeading = this.lastHeading.magneticHeading;\n    }\n    \n    var arr = this.callbacks.onHeadingChanged;\n    for (var i = 0, len = arr.length; i < len; i++) \n    {\n        arr[i](returnHeading);\n    }\n    // callbacks are only used once, so cleanup\n    this.callbacks.onHeadingChanged = [];\n    this.callbacks.onError = [];\n};\n\n/**\n * Called by the geolocation framework when an error occurs while looking up the current position.\n * @param {String} message The text of the error message.\n */\nCompass.prototype.setError = function(message) \n{\n    this.lastError = message;\n    var arr = this.callbacks.onError;\n    for (var i = 0,len = arr.';b.b.b+='length; i < len; i++) \n    {\n        arr[i](message);\n    }\n    // callbacks are only used once, so cleanup\n    this.callbacks.onHeadingChanged = [];\n    this.callbacks.onError = [];\n    this.stop();\n};\n\nCompass.prototype.start = function(args) \n{\n    PhoneGap.exec("Location.startHeading", args);\n};\n\nCompass.prototype.stop = function() \n{\n    PhoneGap.exec("Location.stopHeading");\n};\n\nPhoneGap.addConstructor(function() \n{\n    if (typeof navigator.compass == "undefined") \n    {\n        navigator.compass = new Compass();\n    }\n});\n};\nif (!PhoneGap.hasResource("media")) {\n\tPhoneGap.addResource("media");\n\n/**\n * Media/Audio override.\n *\n */\n \nMedia = function(src, successCallback, errorCallback, downloadCompleteCallback) {\n\t\n\tif (!src) {\n\t\tsrc = "documents://" + String((new Date()).getTime()).replace(/\\D/gi,\'\'); // random\n\t}\n\tthis.src = src;\n\tvar successCB = (successCallback == undefined || successCallback == null) ? null : GetFunctionName(successCallback);\n\tvar errorCB = (errorCallback == undefined || errorCallback == null) ? null : GetFunctionName(errorCallback);\n\tvar downloadCB = (downloadCompleteCallback == undefined || downloadCompleteCallback == null) ? null : GetFunctionName(downloadCompleteCallback);\n\t\n\tthis.successCallback = successCallback || null;\n\tthis.errorCallback = errorCallback || null;\t\n\tthis.downloadCompleteCallback = downloadCompleteCallback || null;\n    \n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.prepare", this.src, successCB, errorCB, downloadCB);\n\t}\n}\n \nMedia.prototype.play = function(options) {\n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.play", this.src, options);\n\t}\n};\n\nMedia.prototype.pause = function() {\n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.pause", this.src);\n\t}\n};\n\nMedia.prototype.stop = function() {\n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.stop", this.src);\n\t}\n};\n\nMedia.prototype.startAudioRecord = function(options) {\n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.startAudioRecord", this.src, options);\n\t}\n};\n\nMedia.prototype.stopAudioRecord = function() {\n\tif (this.src != null) {\n\t\tPhoneGap.exec("Sound.stopAudioRecord", this.src);\n\t}\n};\n\n/**\n * This class contains information about any Media errors.\n * @constructor\n */\nMediaError = function() {\n\tthis.code = null,\n\tthis.message = "";\n}\n\nMediaError.MEDIA_ERR_ABORTED \t\t= 1;\nMediaError.MEDIA_ERR_NETWORK \t\t= 2;\nMediaError.MEDIA_ERR_DECODE \t\t= 3;\nMediaError.MEDIA_ERR_NONE_SUPPORTED = 4;\n\n\n//if (typeof navigator.audio == "undefined") navigator.audio = new Media(src);\n};if (!PhoneGap.hasResource("notification")) {\n\tPhoneGap.addResource("notification");\n\n/**\n * This class provides access to notifications on the device.\n */\nNotification = function() {\n};\n\n/**\n * Open a native alert dialog, with a customizable title and button text.\n *\n * @param {String} message              Message to print in the body of the alert\n * @param {Function} completeCallback   The callback that is called when user clicks on a button.\n * @param {String} title                Title of the alert dialog (default: Alert)\n * @param {String} buttonLabel          Label of the close button (default: OK)\n */\nNotification.prototype.alert = function(message, completeCallback, title, buttonLabel) {\n    var _title = (title || "Alert");\n    var _buttonLabel = (buttonLabel || "OK");\n    PhoneGap.exec(completeCallback, null, "Notification", "alert", [message,{ "title": _title, "buttonLabel": _buttonLabel}]);\n};\n\n/**\n * Open a native confirm dialog, with a customizable title and button text.\n * The result that the user selects is returned to the result callback.\n *\n * @param {String} message              Message to print in the body of the alert\n * @param {Function} resultCallback     The callback that is called when user clicks on a button.\n * @param {String} title                Title of the alert dialog (default: Confirm)\n * @param {String} buttonLabels         Comma separated list of the labels of the buttons (default: \'OK,Cancel\')\n */\nNotification.prototype.confirm = function(message, resultCallback, title, buttonLabels) {\n    var _title = (title || "Confirm");\n    var _buttonLabels = (buttonLabels || "OK,Cancel");\n    this.alert(message, resultCallback, _title, _buttonLabels);\n};\n/**\n * Start spinning the activity indicator on the statusbar\n */\nNotification.prototype.activityStart = function() {\n\tconsole.warn("Notification.activityStart is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");\n    PhoneGap.exec(null, null, "Notification", "activityStart", []);\n};\n\n/**\n * Stop spinning the activity indicator on the statusbar, if it\'s currently spinning\n */\nNotification.prototype.activityStop = function() {\n\tconsole.warn("Notification.activityStop is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");\n    PhoneGap.exec(null, null, "Notification", "activityStop", []);\n};\n\n// iPhone only\nNotification.prototype.loadingStart = function(options) {\n\tconsole.warn("Notification.loadingStart is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");\n    PhoneGap.exec(null, null, "Notification","loadingStart", [options]);\n};\n// iPhone only\nNotification.prototype.loadingStop = function() {\n\tconsole.warn("Notification.loadingStop is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");\n    PhoneGap.exec(null, null, "Notification","loadingStop", []);\n};\n/**\n * Causes the device to blink a status LED.\n * @param {Integer} count The number of blinks.\n * @param {String} colour The colour of the light.\n */\nNotification.prototype.blink = function(count, colour) {\n// NOT IMPLEMENTED\t\n};\n\nNotification.prototype.vibrate = function(mills) {\n\tPhoneGap.exec(null, null, "Notification", "vibrate", []);\n};\n\nNotification.prototype.beep = function(count, volume) {\n\t// No Volume yet for the iphone interface\n\t// We can use a canned beep sound and call that\n\tnew Media(\'beep.wav\').play();\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.notification == "undefined") navigator.notification = new Notification();\n});\n};\nif (!PhoneGap.hasResource("orientation")) {\n\tPhoneGap.addResource("orientation");\n\n/**\n * This class provides access to the device orientation.\n * @constructor\n */\nOrientation  = function() {\n\t/**\n\t * The current orientation, or null if the orientation hasn\'t changed yet.\n\t */\n\tthis.currentOrientation = null;\n}\n\n/**\n * Set the current orientation of the phone.  This is called from the device automatically.\n * \n * When the orientation is changed, the DOMEvent \\c orientationChanged is dispatched against\n * the document element.  The event has the property \\c orientation which can be used to retrieve\n * the device\'s current orientation, in addition to the \\c Orientation.currentOrientation class property.\n *\n * @param {Number} orientation The orientation to be set\n */\nOrientation.prototype.setOrientation = function(orientation) {\n    Orientation.currentOrientation = orientation;\n    var e = document.createEvent(\'Events\');\n    e.initEvent(\'orientationChanged\', \'false\', \'false\');\n    e.orientation = orientation;\n    document.dispatchEvent(e);\n};\n\n/**\n * Asynchronously aquires the current orientation.\n * @param {Function} successCallback The function to call when the orientation\n * is known.\n * @param {Function} errorCallback The function to call when there is an error \n * getting the orientation.\n */\nOrientation.prototype.getCurrentOrientation = function(successCallback, errorCallback) {\n\t// If the position is available then call success\n\t// If the position is not available then call error\n};\n\n/**\n * Asynchronously aquires the orientation repeatedly at a given interval.\n * @param {Function} successCallback The function to call each time the orientation\n * data is available.\n * @param {Function} errorCallback The function to call when there is an error \n * getting the orientation data.\n */\nOrientation.prototype.watchOrientation = function(successCallback, errorCallback) {\n\t// Invoke the appropriate callback with a new Position object every time the implementation \n\t// determines that the position of the hosting device has changed. \n\tthis.getCurrentPosition(successCallback, errorCallback);\n\treturn setInterval(function() {\n\t\tnavigator.orientation.getCurrentOrientation(successCallback, errorCallback);\n\t}, 10000);\n};\n\n/**\n * Clears the specified orientation watch.\n * @param {String} watchId The ID of the watch returned from #watchOrientation.\n */\nOrientation.prototype.clearWatch = function(watchId) {\n\tclearInterval(watchId);\n};\n\nOrientation.install = function()\n{\n    if (typeof navigator.orientation == "undefined") { \n\t\tnavigator.orientation = new Orientation();\n\t}\n\t\n\tvar windowDispatchAvailable = !(window.dispatchEvent === undefined); // undefined in iOS 3.x\n\tif (windowDispatchAvailable) {\n\t\treturn;\n\t} \n\t\n\t// the code below is to capture window.add/remove eventListener calls on window\n\t// this is for iOS 3.x where listening on \'orientationchange\' events don\'t work on document/window (don\'t know why)\n\t// however, window.onorientationchange DOES handle the \'orientationchange\' event (sent through document), so...\n\t// then we multiplex the window.onorientationchange event (consequently - people shouldn\'t overwrite this)\n\t\n\tvar self = this;\n\tvar orientationchangeEvent = \'orientationchange\';\n\tvar newOrientationchangeEvent = \'orientationchange_pg\';\n\t\n\t// backup original `window.addEventListener`, `window.removeEventListener`\n    var _addEventListener = window.addEventListener;\n    var _removeEventListener = window.removeEventListener;\n\n\twindow.onorientationchange = function() {\n\t\tPhoneGap.fireEvent(newOrientationchangeEvent, window);\n\t}\n\t\n    // override `window.addEventListener`\n    window.addEventListener = function() {\n        if (arguments[0] === orientationchangeEvent) {\n\t\t\targuments[0] = newOrientationchangeEvent; \n\t\t} \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tif (!windowDispatchAvailable) {\n\t\t\treturn document.addEventListener.apply(this, arguments);\n\t\t} else {\n\t\t\treturn _addEventListener.apply(this, arguments);\n\t\t}\n    };\t\n\n    // override `window.removeEventListener\'\n    window.removeEventListener = function() {\n        if (arguments[0] === orientationchangeEvent) {\n\t\t\targuments[0] = newOrientationchangeEvent; \n\t\t} \n\t\t\n\t\tif (!windowDispatchAvailable) {\n\t\t\treturn document.removeEventListener.apply(this, arguments);\n\t\t} else {\n\t\t\treturn _removeEventListener.apply(this, arguments);\n\t\t}\n    };\t\n};\n\nPhoneGap.addConstructor(Orientation.install);\n\n};\nif (!PhoneGap.hasResource("sms")) {\n\tPhoneGap.addResource("sms");\n\n/**\n * This class provides access to the device SMS functionality.\n * @constructor\n */\nSms = function() {\n\n}\n\n/**\n * Sends an SMS message.\n * @param {Integer} number The phone number to send the message to.\n * @param {String} message The contents of the SMS message to send.\n * @param {Function} successCallback The function to call when the SMS message is sent.\n * @param {Function} errorCallback The function to call when there is an error sending the SMS message.\n * @param {PositionOptions} options The options for accessing the GPS location such as timeout and accuracy.\n */\nSms.prototype.send = function(number, message, successCallback, errorCallback, options) {\n\t// not sure why this is here when it does nothing????\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.sms == "undefined") navigator.sms = new Sms();\n});\n};\nif (!PhoneGap.hasResource("telephony")) {\n\tPhoneGap.addResource("telephony");\n\n/**\n * This class provides access to the telephony features of the device.\n * @constructor\n */\nTelephony = function() {\n\t\n}\n\n/**\n * Calls the specifed number.\n * @param {Integer} number The number to be called.\n */\nTelephony.prototype.call = function(number) {\n\t// not sure why this is here when it does nothing????\n};\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.telephony == "undefined") navigator.telephony = new Telephony();\n});\n};if (!PhoneGap.hasResource("network")) {\n\tPhoneGap.addResource("network");\n\n// //////////////////////////////////////////////////////////////////\n\nConnection = function() {\n\t/*\n\t * One of the connection constants below.\n\t */\n\tthis.type = Connection.UNKNOWN;\n\n\t/* initialize from the extended DeviceInfo properties */\n    try {      \n\t\tthis.type\t= DeviceInfo.connection.type;\n    } \n\tcatch(e) {\n    }\n};\n\nConnection.UNKNOWN = "unknown"; // Unknown connection type\nConnection.ETHERNET = "ethernet";\nConnection.WIFI = "wifi";\nConnection.CELL_2G = "2g";\nConnection.CELL_3G = "3g";\nConnection.CELL_4G = "4g";\nConnection.NONE = "none"; // NO connectivity\n\n// //////////////////////////////////////////////////////////////////\n\t\n/**\n * This class contains information about any NetworkStatus.\n * @constructor\n */\nNetworkStatus = function() {\n\tthis.code = null;\n\tthis.message = "";\n}\n\nNetworkStatus.NOT_REACHABLE = 0;\nNetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK = 1;\nNetworkStatus.REACHABLE_VIA_WIFI_NETWORK = 2;\n\n/**\n * This class provides access to device Network data (reachability).\n * @constructor\n */\nNetwork = function() {\n};\n\n/**\n * \n * @param {Function} successCallback\n * @param {Function} errorCallback\n * @param {Object} options\n */\nNetwork.prototype.isReachable = function(hostName, successCallback, options) {\n\tconsole.warn("Network.isReachable is deprecated and will be removed in 1.0. Please use the Network Information API instead.");\n\tPhoneGap.exec("Network.isReachable", hostName, GetFunctionName(successCallback), options);\n};\n\n\nPhoneGap.addConstructor(function() {\n    if (typeof navigator.network == "undefined") navigator.network = new Network();\n    if (typeof navigator.network.connection == "undefined") navigator.network.connection = new Connection();\n});\n\n};';return b.b.b};
--></script>
<script><!--
_.cM={};_=Ep.prototype=Dp.prototype=new v;_.gC=function Fp(){return ti};_.db=function Gp(){return 'ios_096_min'};
--></script>
<script><!--
_.eb=function Hp(){var b;b=new Nw;b.b.b+='var _anomFunkMap={};var _anomFunkMapNextId=0;function anomToNameFunk(fun){var funkId="f"+_anomFunkMapNextId++;var funk=function(){fun.apply(this,arguments);_anomFunkMap[funkId]=null;delete _anomFunkMap[funkId]};_anomFunkMap[funkId]=funk;return"_anomFunkMap."+funkId}function GetFunctionName(fn){if(typeof fn==="function"){var name=fn.name;if(!name){var m=fn.toString().match(/^\\s*function\\s+([^\\s\\(]+)/);name=m&&m[1]}if(name&&(window[name]===fn)){return name}else{return anomToNameFunk(fn)}}else{return null}}if(typeof PhoneGap==="undefined"){if(typeof(DeviceInfo)!=="object"){DeviceInfo={}}PhoneGap={queue:{ready:true,commands:[],timer:null},_constructors:[]};PhoneGap.resources={base:true};PhoneGap.hasResource=function(name){return PhoneGap.resources[name]};PhoneGap.addResource=function(name){PhoneGap.resources[name]=true};PhoneGap.available=DeviceInfo.uuid!=undefined;PhoneGap.addConstructor=function(func){var state=document.readyState;if((state=="loaded"||state=="complete")&&DeviceInfo.uuid!=null){func()}else{PhoneGap._constructors.push(func)}};(function(){var timer=setInterval(function(){var state=document.readyState;if((state=="loaded"||state=="complete")&&DeviceInfo.uuid!=null){clearInterval(timer);while(PhoneGap._constructors.length>0){var constructor=PhoneGap._constructors.shift();try{constructor()}catch(e){if(typeof(debug.log)=="function"){debug.log("Failed to run constructor: "+debug.processMessage(e))}else{alert("Failed to run constructor: "+e.message)}}}var e=document.createEvent("Events");e.initEvent("deviceready");document.dispatchEvent(e)}},1)})();PhoneGap.callbackId=0;PhoneGap.callbacks={};PhoneGap.callbackStatus={NO_RESULT:0,OK:1,CLASS_NOT_FOUND_EXCEPTION:2,ILLEGAL_ACCESS_EXCEPTION:3,INSTANTIATION_EXCEPTION:4,MALFORMED_URL_EXCEPTION:5,IO_EXCEPTION:6,INVALID_ACTION:7,JSON_EXCEPTION:8,ERROR:9};PhoneGap.exec=function(){PhoneGap.queue.commands.push(arguments);if(PhoneGap.queue.timer==null){PhoneGap.queue.timer=setInterval(PhoneGap.run_command,10)}};PhoneGap.run_command=function(){if(!PhoneGap.available||!PhoneGap.queue.ready){return}PhoneGap.queue.ready=false;if(!this.gapBridge){this.gapBridge=document.createElement("iframe");this.gapBridge.setAttribute("style","display:none;");this.gapBridge.setAttribute("height","0px");this.gapBridge.setAttribute("width","0px");this.gapBridge.setAttribute("frameborder","0");document.documentElement.appendChild(this.gapBridge)}var args=PhoneGap.queue.commands.shift();if(PhoneGap.queue.commands.length==0){clearInterval(PhoneGap.queue.timer);PhoneGap.queue.timer=null}var service;var callbackId=null;var start=0;try{if(args[0]==null||typeof args[0]==="function"){var success=args[0];var fail=args[1];service=args[2]+"."+args[3];args=args[4];callbackId=service+PhoneGap.callbackId++;if(success||fail){PhoneGap.callbacks[callbackId]={success:success,fail:fail}}}else{service=args[0];start=1}var uri=[];var dict=null;for(var i=start;i<args.length;i++){var arg=args[i];if(arg==undefined||arg==null){continue}if(typeof(arg)=="object"){dict=arg}else{uri.push(encodeURIComponent(arg))}}var next=callbackId!=null?("/"+callbackId+"/"):"/";var url="gap://"+service+next+uri.join("/");if(dict!=null){url+="?"+encodeURIComponent(JSON.stringify(dict))}this.gapBridge.src=url}catch(e){console.log("PhoneGapExec Error: "+e)}};PhoneGap.callbackSuccess=function(callbackId,args){if(PhoneGap.callbacks[callbackId]){if(args.status==PhoneGap.callbackStatus.OK){try{if(PhoneGap.callbacks[callbackId].success){PhoneGap.callbacks[callbackId].success(args.message)}}catch(e){console.log("Error in success callback: "+callbackId+" = "+e)}}if(!args.keepCallback){delete PhoneGap.callbacks[callbackId]}}};PhoneGap.callbackError=function(callbackId,args){if(PhoneGap.callbacks[callbackId]){try{if(PhoneGap.callbacks[callbackId].fail){PhoneGap.callbacks[callbackId].fail(args.message)}}catch(e){console.log("Error in error callback: "+callbackId+" = "+e)}if(!args.keepCallback){delete PhoneGap.callbacks[callbackId]}}};PhoneGap.clone=function(obj){if(!obj){return obj}if(obj instanceof Array){var retVal=new Array();for(var i=0;i<obj.length;++i){retVal.push(PhoneGap.clone(obj[i]))}return retVal}if(obj instanceof Function){return obj}if(!(obj instanceof Object)){return obj}if(obj instanceof Date){return obj}retVal=new Object();for(i in obj){if(!(i in retVal)||retVal[i]!=obj[i]){retVal[i]=PhoneGap.clone(obj[i])}}return retVal};PhoneGap.m_document_addEventListener=document.addEventListener;document.addEventListener=function(evt,handler,capture){var e=evt.toLowerCase();if(e==="unload"){PhoneGap.onUnload=function(e){return handler(e)}}else{PhoneGap.m_document_addEventListener.call(document,evt,handler,capture)}};PhoneGap.m_document_removeEventListener=document.removeEventListener;document.removeEventListener=function(evt,handler,capture){var e=evt.toLowerCase();if(e==="unload"){PhoneGap.onUnload=null}PhoneGap.m_document_removeEventListener.call(document,evt,handler,capture)};PhoneGap.fireEvent=function(type,target){var e=document.createEvent("Events");e.initEvent(type);target=target||document;if(target.dispatchEvent===undefined){target=document}target.dispatchEvent(e)}}if(!PhoneGap.hasResource("debugconsole")){PhoneGap.addResource("debugconsole");DebugConsole=function(isDeprecated){this.logLevel=DebugConsole.INFO_LEVEL;this.isDeprecated=isDeprecated?true:false};DebugConsole.ALL_LEVEL=1;DebugConsole.INFO_LEVEL=1;DebugConsole.WARN_LEVEL=2;DebugConsole.ERROR_LEVEL=4;DebugConsole.NONE_LEVEL=8;DebugConsole.prototype.setLevel=function(level){this.logLevel=level};DebugConsole.prototype.processMessage=function(message,maxDepth){if(maxDepth===undefined){maxDepth=0}if(typeof(message)!="object"){return(this.isDeprecated?"WARNING: debug object is deprecated, please use console object \\n"+message:message)}else{function indent(str){return str.replace(/^/mg,"    ")}function makeStructured(obj,depth){var str="";for(var i in obj){try{if(typeof(obj[i])=="object"&&depth<maxDepth){str+=i+":\\n"+indent(makeStructured(obj[i]))+"\\n"}else{str+=i+" = "+indent(String(obj[i])).replace(/^    /,"")+"\\n"}}catch(e){str+=i+" = EXCEPTION: "+e.message+"\\n"}}return str}return((this.isDeprecated?"WARNING: debug object is deprecated, please use console object\\n":"")+"Object:\\n"+makeStructured(message,maxDepth))}};DebugConsole.prototype.log=function(message,maxDepth){if(PhoneGap.available&&this.logLevel<=DebugConsole.INFO_LEVEL){PhoneGap.exec("DebugConsole.log",this.processMessage(message,maxDepth),{logLevel:"INFO"})}else{console.log(message)}};DebugConsole.prototype.warn=function(message,maxDepth){if(PhoneGap.available&&this.logLevel<=DebugConsole.WARN_LEVEL){PhoneGap.exec("DebugConsole.log",this.processMessage(message,maxDepth),{logLevel:"WARN"})}else{console.error(message)}};DebugConsole.prototype.error=function(message,maxDepth){if(PhoneGap.available&&this.logLevel<=DebugConsole.ERROR_LEVEL){PhoneGap.exec("DebugConsole.log",this.processMessage(message,maxDepth),{logLevel:"ERROR"})}else{console.error(message)}};PhoneGap.addConstructor(function(){window.console=new DebugConsole();window.debug=new DebugConsole(true)})}if(!PhoneGap.hasResource("position")){PhoneGap.addResource("position");Position=function(coords,timestamp){this.coords=Coordinates.cloneFrom(coords);this.timestamp=timestamp||new Date().getTime()};Position.prototype.equals=function(other){return(this.coords&&other&&other.coords&&this.coords.latitude==other.coords.latitude&&this.coords.longitude==other.coords.longitude)};Position.prototype.clone=function(){return new Position(this.coords?this.coords.clone():null,this.timestamp?this.timestamp:new Date().getTime())};Coordinates=function(lat,lng,alt,acc,head,vel,altAcc){this.latitude=lat;this.longitude=lng;this.altitude=alt;this.accuracy=acc;this.heading=head;this.speed=vel;this.altitudeAccuracy=(altAcc!="undefined")?altAcc:null};Coordinates.prototype.clone=function(){return new Coordinates(this.latitude,this.longitude,this.altitude,this.accuracy,this.heading,this.speed,this.altitudeAccuracy)};Coordinates.cloneFrom=function(obj){return new Coordinates(obj.latitude,obj.longitude,obj.altitude,obj.accuracy,obj.heading,obj.speed,obj.altitudeAccuracy)};PositionOptions=function(enableHighAccuracy,timeout,maximumAge){this.enableHighAccuracy=enableHighAccuracy||false;this.timeout=timeout||10000;this.maximumAge=maximumAge||0};PositionError=function(code,message){this.code=code||0;this.message=message||""};PositionError.UNKNOWN_ERROR=0;PositionError.PERMISSION_DENIED=1;PositionError.POSITION_UNAVAILABLE=2;PositionError.TIMEOUT=3}if(!PhoneGap.hasResource("acceleration")){PhoneGap.addResource("acceleration");Acceleration=function(x,y,z){this.x=x;this.y=y;this.z=z;this.timestamp=new Date().getTime()};AccelerationOptions=function(){this.timeout=10000}}if(!PhoneGap.hasResource("accelerometer")){PhoneGap.addResource("accelerometer");Accelerometer=function(){this.lastAcceleration=new Acceleration(0,0,0)};Accelerometer.prototype.getCurrentAcceleration=function(successCallback,errorCallback,options){if(typeof successCallback=="function"){successCallback(this.lastAcceleration)}};Accelerometer.prototype._onAccelUpdate=function(x,y,z){this.lastAcceleration=new Acceleration(x,y,z)};Accelerometer.prototype.watchAcceleration=function(successCallback,errorCallback,options){var frequency=(options!=undefined&&options.frequency!=undefined)?options.frequency:10000;var updatedOptions={desiredFrequency:frequency};PhoneGap.exec("Accelerometer.start",options);return setInterval(function(){navigator.accelerometer.getCurrentAcceleration(successCallback,errorCallback,options)},frequency)};Accelerometer.prototype.clearWatch=function(watchId){PhoneGap.exec("Accelerometer.stop");clearInterval(watchId)};Accelerometer.install=function(){if(typeof navigator.accelerometer=="undefined"){navigator.accelerometer=new Accelerometer()}};Accelerometer.installDeviceMotionHandler=function(){if(!(window.DeviceMotionEvent==undefined)){return}var self=this;var devicemotionEvent="devicemotion";self.deviceMotionWatchId=null;self.deviceMotionListenerCount=0;self.deviceMotionLastEventTimestamp=0;var _addEventListener=window.addEventListener;var _removeEventListener=window.removeEventListener;var windowDispatchAvailable=!(window.dispatchEvent===undefined);var accelWin=function(acceleration){var evt=document.createEvent("Events");evt.initEvent(devicemotionEvent);evt.acceleration=null;evt.rotationRate=null;evt.accelerationIncludingGravity=acceleration;var currentTime=new Date().getTime();evt.interval=(self.deviceMotionLastEventTimestamp==0)?0:(currentTime-self.deviceMotionLastEventTimestamp);self.deviceMotionLastEventTimestamp=currentTime;if(windowDispatchAvailable){window.dispatchEvent(evt)}else{document.dispatchEvent(evt)}};var accelFail=function(){};window.addEventListener=function(){if(arguments[0]===devicemotionEvent){++(self.deviceMotionListenerCount);if(self.deviceMotionListenerCount==1){self.deviceMotionWatchId=navigator.accelerometer.watchAcceleration(accelWin,accelFail,{frequency:500})}}if(!windowDispatchAvailable){return document.addEventListener.apply(this,arguments)}else{return _addEventListener.apply(this,arguments)}};window.removeEventListener=function(){if(arguments[0]===devicemotionEvent){--(self.deviceMotionListenerCount);if(self.deviceMotionListenerCount==0){navigator.accelerometer.clearWatch(self.deviceMotionWatchId)}}if(!windowDispatchAvailable){return document.removeEventListener.apply(this,arguments)}else{return _removeEventListener.apply(this,arguments)}}};PhoneGap.addConstructor(Accelerometer.install);PhoneGap.addConstructor(Accelerometer.installDeviceMotionHandler)}if(!PhoneGap.hasResource("camera")){PhoneGap.addResource("camera");Camera=function(){};Camera.DestinationType={DATA_URL:0,FILE_URI:1};Camera.prototype.DestinationType=Camera.DestinationType;Camera.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2};Camera.prototype.PictureSourceType=Camera.PictureSourceType;Camera.prototype.getPicture=function(successCallback,errorCallback,options){console.warn("Camera.getPicture is deprecated and will be removed in 1.0, and put in the plugins repo. Plese use the Media Capture API instead.");if(typeof successCallback!="function"){console.log("Camera Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!="function")){console.log("Camera Error: errorCallback is not a function");return}PhoneGap.exec(successCallback,errorCallback,"Camera","getPicture",[options])};PhoneGap.addConstructor(function(){if(typeof navigator.camera=="undefined"){navigator.camera=new Camera()}})}if(!PhoneGap.hasResource("capture")){PhoneGap.addResource("capture");function CaptureError(){this.code=null}CaptureError.CAPTURE_INTERNAL_ERR=0;CaptureError.CAPTURE_APPLICATION_BUSY=1;CaptureError.CAPTURE_INVALID_ARGUMENT=2;CaptureError.CAPTURE_NO_MEDIA_FILES=3;CaptureError.CAPTURE_NOT_SUPPORTED=20;function Capture(){this.supportedAudioModes=[];this.supportedImageModes=[];this.supportedVideoModes=[]}Capture.prototype.captureAudio=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureAudio",[options])};Capture.prototype.captureImage=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureImage",[options])};Capture.prototype._castMediaFile=function(pluginResult){var mediaFiles=[];var i;for(i=0;i<pluginResult.message.length;i++){var mediaFile=new MediaFile();mediaFile.name=pluginResult.message[i].name;mediaFile.fullPath=pluginResult.message[i].fullPath;mediaFile.type=pluginResult.message[i].type;mediaFile.lastModifiedDate=pluginResult.message[i].lastModifiedDate;mediaFile.size=pluginResult.message[i].size;mediaFiles.push(mediaFile)}pluginResult.message=mediaFiles;return pluginResult};Capture.prototype.captureVideo=function(successCallback,errorCallback,options){PhoneGap.exec(successCallback,errorCallback,"Capture","captureVideo",[options])};function ConfigurationData(){this.type;this.height=0;this.width=0}var CaptureImageOptions=function(){this.limit=1;this.mode=null};var CaptureVideoOptions=function(){this.limit=1;this.duration=0;this.mode=null};var CaptureAudioOptions=function(){this.limit=1;this.duration=0;this.mode=null};function MediaFile(name,fullPath,type,lastModifiedDate,size){this.name=name||null;this.fullPath=fullPath||null;this.type=type||null;this.lastModifiedDate=lastModifiedDate||null;this.size=size||0}MediaFile.prototype.getFormatData=function(successCallback,errorCallback){if(typeof this.fullPath==="undefined"||this.fullPath===null){errorCallback({code:CaptureError.CAPTURE_INVALID_ARGUMENT})}else{PhoneGap.exec(successCallback,errorCallback,"Capture","getFormatData",[this.fullPath,this.type])}};function MediaFileData(codecs,bitrate,height,width,duration){this.codecs=codecs||null;this.bitrate=bitrate||0;this.height=height||0;this.width=width||0;this.duration=duration||0}PhoneGap.addConstructor(function(){if(typeof navigator.device==="undefined"){navigator.device=window.device=new Device()}if(typeof navigator.device.capture==="undefined"){navigator.device.capture=window.device.capture=new Capture()}})}if(!PhoneGap.hasResource("contact")){PhoneGap.addResource("contact");var Contact=function(id,displayName,name,nickname,phoneNumbers,emails,addresses,ims,organizations,revision,birthday,gender,note,photos,categories,urls,timezone){this.id=id||null;this.displayName=displayName||null;this.name=name||null;this.nickname=nickname||null;this.phoneNumbers=phoneNumbers||null;this.emails=emails||null;this.addresses=addresses||null;this.ims=ims||null;this.organizations=organizations||null;this.revision=revision||null;this.birthday=birthday||null;this.gender=gender||null;this.note=note||null;this.photos=photos||null;this.categories=categories||null;this.urls=urls||null;this.timezone=timezone||null};Contact.prototype.convertDatesOut=function(){var dates=new Array("revision","birthday");for(var i=0;i<dates.length;i++){var value=this[dates[i]];if(value){if(!value instanceof Date){try{value=new Date(value)}catch(exception){value=null}}if(value instanceof Date){value=value.valueOf()}this[dates[i]]=value}}};Contact.prototype.convertDatesIn=function(){var dates=new Array("revision","birthday");for(var i=0;i<dates.length;i++){var value=this[dates[i]];if(value){try{this[dates[i]]=new Date(parseFloat(value))}catch(exception){console.log("exception creating date")}}';b.b.b+='}};Contact.prototype.remove=function(successCB,errorCB){if(this.id==null){var errorObj=new ContactError();errorObj.code=ContactError.NOT_FOUND_ERROR;errorCB(errorObj)}else{PhoneGap.exec(successCB,errorCB,"Contacts","remove",[{contact:this}])}};Contact.prototype.display=function(successCB,errorCB,options){if(this.id==null){var errorObj=new ContactError();errorObj.code=ContactError.NOT_FOUND_ERROR;errorCB(errorObj)}else{PhoneGap.exec(successCB,errorCB,"Contacts","displayContact",[this.id,options])}};Contact.prototype.clone=function(){var clonedContact=PhoneGap.clone(this);clonedContact.id=null;if(clonedContact.phoneNumbers){for(i=0;i<clonedContact.phoneNumbers.length;i++){clonedContact.phoneNumbers[i].id=null}}if(clonedContact.emails){for(i=0;i<clonedContact.emails.length;i++){clonedContact.emails[i].id=null}}if(clonedContact.addresses){for(i=0;i<clonedContact.addresses.length;i++){clonedContact.addresses[i].id=null}}if(clonedContact.ims){for(i=0;i<clonedContact.ims.length;i++){clonedContact.ims[i].id=null}}if(clonedContact.organizations){for(i=0;i<clonedContact.organizations.length;i++){clonedContact.organizations[i].id=null}}if(clonedContact.photos){for(i=0;i<clonedContact.photos.length;i++){clonedContact.photos[i].id=null}}if(clonedContact.urls){for(i=0;i<clonedContact.urls.length;i++){clonedContact.urls[i].id=null}}return clonedContact};Contact.prototype.save=function(successCB,errorCB){var cloned=PhoneGap.clone(this);cloned.convertDatesOut();PhoneGap.exec(successCB,errorCB,"Contacts","save",[{contact:cloned}])};var ContactName=function(formatted,familyName,givenName,middle,prefix,suffix){this.formatted=formatted!="undefined"?formatted:null;this.familyName=familyName!="undefined"?familyName:null;this.givenName=givenName!="undefined"?givenName:null;this.middleName=middle!="undefined"?middle:null;this.honorificPrefix=prefix!="undefined"?prefix:null;this.honorificSuffix=suffix!="undefined"?suffix:null};var ContactField=function(type,value,pref,id){this.type=type!="undefined"?type:null;this.value=value!="undefined"?value:null;this.pref=pref!="undefined"?pref:null;this.id=id!="undefined"?id:null};var ContactAddress=function(formatted,streetAddress,locality,region,postalCode,country,id){this.formatted=formatted!="undefined"?formatted:null;this.streetAddress=streetAddress!="undefined"?streetAddress:null;this.locality=locality!="undefined"?locality:null;this.region=region!="undefined"?region:null;this.postalCode=postalCode!="undefined"?postalCode:null;this.country=country!="undefined"?country:null;this.id=id!="undefined"?id:null};var ContactOrganization=function(name,dept,title,startDate,endDate,location,desc){this.name=name!="undefined"?name:null;this.department=dept!="undefined"?dept:null;this.title=title!="undefined"?title:null;this.startDate=startDate!="undefined"?startDate:null;this.endDate=endDate!="undefined"?endDate:null;this.location=location!="undefined"?location:null;this.description=desc!="undefined"?desc:null};var ContactAccount=function(domain,username,userid){this.domain=domain!="undefined"?domain:null;this.username=username!="undefined"?username:null;this.userid=userid!="undefined"?userid:null};var Contacts=function(){this.inProgress=false;this.records=new Array();this.resultsCallback=null;this.errorCallback=null};Contacts.prototype.find=function(fields,successCB,errorCB,options){var theOptions=options||null;if(theOptions!=null){var value=theOptions.updatedSince;if(value!=""){if(!value instanceof Date){try{value=new Date(value)}catch(exception){value=null}}if(value instanceof Date){theOptions.updatedSince=value.valueOf()}}}PhoneGap.exec(successCB,errorCB,"Contacts","search",[{fields:fields,findOptions:theOptions}])};Contacts.prototype._findCallback=function(pluginResult){var contacts=new Array();try{for(var i=0;i<pluginResult.message.length;i++){var newContact=navigator.service.contacts.create(pluginResult.message[i]);newContact.convertDatesIn();contacts.push(newContact)}pluginResult.message=contacts}catch(e){console.log("Error parsing contacts: "+e)}return pluginResult};Contacts.prototype._contactCallback=function(pluginResult){var newContact=null;if(pluginResult.message){try{newContact=navigator.service.contacts.create(pluginResult.message);newContact.convertDatesIn()}catch(e){console.log("Error parsing contact")}}pluginResult.message=newContact;return pluginResult};Contacts.prototype._errCallback=function(pluginResult){var errorObj=new ContactError();errorObj.code=pluginResult.message;pluginResult.message=errorObj;return pluginResult};Contacts.prototype.newContactUI=function(successCallback){PhoneGap.exec(successCallback,null,"Contacts","newContact",[])};Contacts.prototype.chooseContact=function(successCallback,options){PhoneGap.exec(successCallback,null,"Contacts","chooseContact",options)};Contacts.prototype.create=function(properties){var contact=new Contact();for(i in properties){if(contact[i]!="undefined"){contact[i]=properties[i]}}return contact};var ContactFindOptions=function(filter,multiple,updatedSince){this.filter=filter||"";this.multiple=multiple||true;this.updatedSince=updatedSince||""};var ContactError=function(){this.code=null};ContactError.UNKNOWN_ERROR=0;ContactError.INVALID_ARGUMENT_ERROR=1;ContactError.NOT_FOUND_ERROR=2;ContactError.TIMEOUT_ERROR=3;ContactError.PENDING_OPERATION_ERROR=4;ContactError.IO_ERROR=5;ContactError.NOT_SUPPORTED_ERROR=6;ContactError.PERMISSION_DENIED_ERROR=20;PhoneGap.addConstructor(function(){if(typeof navigator.service=="undefined"){navigator.service=new Object()}if(typeof navigator.service.contacts=="undefined"){navigator.service.contacts=new Contacts()}})}if(!PhoneGap.hasResource("device")){PhoneGap.addResource("device");Device=function(){this.platform=null;this.version=null;this.name=null;this.phonegap=null;this.uuid=null;try{this.platform=DeviceInfo.platform;this.version=DeviceInfo.version;this.name=DeviceInfo.name;this.phonegap=DeviceInfo.gap;this.uuid=DeviceInfo.uuid}catch(e){}this.available=PhoneGap.available=this.uuid!=null};PhoneGap.addConstructor(function(){if(typeof navigator.device==="undefined"){navigator.device=window.device=new Device()}})}if(!PhoneGap.hasResource("file")){PhoneGap.addResource("file");FileProperties=function(filePath){this.filePath=filePath;this.size=0;this.lastModifiedDate=null};File=function(name,fullPath,type,lastModifiedDate,size){this.name=name||null;this.fullPath=fullPath||null;this.type=type||null;this.lastModifiedDate=lastModifiedDate||null;this.size=size||0};File._createEvent=function(type,target){var evt={type:type};evt.target=target;return evt};FileError=function(){this.code=null};FileError.NOT_FOUND_ERR=1;FileError.SECURITY_ERR=2;FileError.ABORT_ERR=3;FileError.NOT_READABLE_ERR=4;FileError.ENCODING_ERR=5;FileError.NO_MODIFICATION_ALLOWED_ERR=6;FileError.INVALID_STATE_ERR=7;FileError.SYNTAX_ERR=8;FileError.INVALID_MODIFICATION_ERR=9;FileError.QUOTA_EXCEEDED_ERR=10;FileError.TYPE_MISMATCH_ERR=11;FileError.PATH_EXISTS_ERR=12;FileMgr=function(){};FileMgr.prototype.testFileExists=function(fileName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","testFileExists",[fileName])};FileMgr.prototype.testDirectoryExists=function(dirName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","testDirectoryExists",[dirName])};FileMgr.prototype.getFreeDiskSpace=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getFreeDiskSpace",[])};FileMgr.prototype.writeAsText=function(fileName,data,bAppend,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","write",[fileName,data,bAppend?1:0])};FileMgr.prototype.write=function(fileName,data,position,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","write",[fileName,data,position])};FileMgr.prototype.truncate=function(fileName,size,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","truncateFile",[fileName,size])};FileMgr.prototype.readAsText=function(fileName,encoding,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readFile",[fileName,encoding])};FileMgr.prototype.readAsDataURL=function(fileName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readAsDataURL",[fileName])};PhoneGap.addConstructor(function(){if(typeof navigator.fileMgr==="undefined"){navigator.fileMgr=new FileMgr()}});FileReader=function(){this.fileName="";this.readyState=0;this.result=null;this.error=null;this.onloadstart=null;this.onprogress=null;this.onload=null;this.onerror=null;this.onloadend=null;this.onabort=null};FileReader.EMPTY=0;FileReader.LOADING=1;FileReader.DONE=2;FileReader.prototype.abort=function(){var evt;this.readyState=FileReader.DONE;this.result=null;var error=new FileError();error.code=error.ABORT_ERR;this.error=error;if(typeof this.onerror==="function"){evt=File._createEvent("error",this);this.onerror(evt)}if(typeof this.onabort==="function"){evt=File._createEvent("abort",this);this.onabort(evt)}if(typeof this.onloadend==="function"){evt=File._createEvent("loadend",this);this.onloadend(evt)}};FileReader.prototype.readAsText=function(file,encoding){this.fileName="";if(typeof file.fullPath==="undefined"){this.fileName=file}else{this.fileName=file.fullPath}this.readyState=FileReader.LOADING;if(typeof this.onloadstart==="function"){var evt=File._createEvent("loadstart",this);this.onloadstart(evt)}var enc=encoding?encoding:"UTF-8";var me=this;navigator.fileMgr.readAsText(this.fileName,enc,function(r){var evt;if(me.readyState===FileReader.DONE){return}me.result=decodeURIComponent(r);if(typeof me.onload==="function"){evt=File._createEvent("load",me);me.onload(evt)}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){evt=File._createEvent("loadend",me);me.onloadend(evt)}},function(e){var evt;if(me.readyState===FileReader.DONE){return}me.error=e;if(typeof me.onerror==="function"){evt=File._createEvent("error",me);me.onerror(evt)}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){evt=File._createEvent("loadend",me);me.onloadend(evt)}})};FileReader.prototype.readAsDataURL=function(file){this.fileName="";if(typeof file.fullPath==="undefined"){this.fileName=file}else{this.fileName=file.fullPath}this.readyState=FileReader.LOADING;if(typeof this.onloadstart==="function"){var evt=File._createEvent("loadstart",this);this.onloadstart(evt)}var me=this;navigator.fileMgr.readAsDataURL(this.fileName,function(r){var evt;if(me.readyState===FileReader.DONE){return}me.result=r;if(typeof me.onload==="function"){evt=File._createEvent("load",me);me.onload(evt)}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){evt=File._createEvent("loadend",me);me.onloadend(evt)}},function(e){var evt;if(me.readyState===FileReader.DONE){return}me.error=e;if(typeof me.onerror==="function"){evt=File._createEvent("error",me);me.onerror(evt)}me.readyState=FileReader.DONE;if(typeof me.onloadend==="function"){evt=File._createEvent("loadend",me);me.onloadend(evt)}})};FileReader.prototype.readAsBinaryString=function(file){this.fileName=file};FileReader.prototype.readAsArrayBuffer=function(file){this.fileName=file};FileWriter=function(file){this.fileName="";this.length=0;if(file){this.fileName=file.fullPath||file;this.length=file.size||0}this.position=0;this.readyState=0;this.result=null;this.error=null;this.onwritestart=null;this.onprogress=null;this.onwrite=null;this.onwriteend=null;this.onabort=null;this.onerror=null};FileWriter.INIT=0;FileWriter.WRITING=1;FileWriter.DONE=2;FileWriter.prototype.abort=function(){if(this.readyState===FileWriter.DONE||this.readyState===FileWriter.INIT){throw FileError.INVALID_STATE_ERR}var error=new FileError(),evt;error.code=error.ABORT_ERR;this.error=error;if(typeof this.onerror==="function"){evt=File._createEvent("error",this);this.onerror(evt)}if(typeof this.onabort==="function"){evt=File._createEvent("abort",this);this.onabort(evt)}this.readyState=FileWriter.DONE;if(typeof this.onwriteend=="function"){evt=File._createEvent("writeend",this);this.onwriteend(evt)}};FileWriter.prototype.writeAsText=function(file,text,bAppend){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}if(bAppend!==true){bAppend=false}this.fileName=file;this.readyState=FileWriter.WRITING;var me=this;if(typeof me.onwritestart==="function"){var evt=File._createEvent("writestart",me);me.onwritestart(evt)}navigator.fileMgr.writeAsText(file,text,bAppend,function(r){var evt;if(me.readyState===FileWriter.DONE){return}me.result=r;if(typeof me.onwrite==="function"){evt=File._createEvent("write",me);me.onwrite(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}},function(e){var evt;if(me.readyState===FileWriter.DONE){return}me.error=e;if(typeof me.onerror==="function"){evt=File._createEvent("error",me);me.onerror(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}})};FileWriter.prototype.write=function(text){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}this.readyState=FileWriter.WRITING;var me=this;if(typeof me.onwritestart==="function"){var evt=File._createEvent("writestart",me);me.onwritestart(evt)}navigator.fileMgr.write(this.fileName,text,this.position,function(r){var evt;if(me.readyState===FileWriter.DONE){return}me.position+=r;me.length=me.position;if(typeof me.onwrite==="function"){evt=File._createEvent("write",me);me.onwrite(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}},function(e){var evt;if(me.readyState===FileWriter.DONE){return}me.error=e;if(typeof me.onerror==="function"){evt=File._createEvent("error",me);me.onerror(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}})};FileWriter.prototype.seek=function(offset){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}if(!offset){return}if(offset<0){this.position=Math.max(offset+this.length,0)}else{if(offset>this.length){this.position=this.length}else{this.position=offset}}};FileWriter.prototype.truncate=function(size){if(this.readyState===FileWriter.WRITING){throw FileError.INVALID_STATE_ERR}this.readyState=FileWriter.WRITING;var me=this;if(typeof me.onwritestart==="function"){var evt=File._createEvent("writestart",me);me.onwritestart(evt)}navigator.fileMgr.truncate(this.fileName,size,function(r){var evt;if(me.readyState===FileWriter.DONE){return}me.length=r;me.position=Math.min(me.position,r);if(typeof me.onwrite==="function"){evt=File._createEvent("write",me);me.onwrite(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}},function(e){var evt;if(me.readyState===FileWriter.DONE){return}me.error=e;if(typeof me.onerror==="function"){evt=File._createEvent("error",me);me.onerror(evt)}me.readyState=FileWriter.DONE;if(typeof me.onwriteend==="function"){evt=File._createEvent("writeend",me);me.onwriteend(evt)}})};LocalFileSystem=function(){};LocalFileSystem.TEMPORARY=0;LocalFileSystem.PERSISTENT=1;LocalFileSystem.RESOURCE=2;LocalFileSystem.APPLICATION=3;LocalFileSystem.prototype.requestFileSystem=function(type,size,successCallback,errorCallback){if(type<0||type>3){if(typeof errorCallback=="function"){errorCallback({code:FileError.SYNTAX_ERR})}}else{PhoneGap.exec(successCallback,errorCallback,"File","requestFileSystem",[type,size])}};LocalFileSystem.prototype.resolveLocalFileSystemURI=function(uri,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","resolveLocalFileSystemURI",[uri])};LocalFileSystem.prototype._castFS=function(pluginResult){var entry=null;entry=new DirectoryEntry();entry.isDirectory=pluginResult.message.root.isDirectory;entry.isFile=pluginResult.message.root.isFile;entry.name=pluginResult.message.root.name;entry.fullPath=pluginResult.message.root.fullPath;pluginResult.message.root=entry;return pluginResult};LocalFileSystem.prototype._castEntry=function(pluginResult){var entry=null;if(pluginResult.message.isDirectory){entry=new DirectoryEntry()}else{if(pluginResult.message.isFile){entry=new FileEntry()}}entry.isDirectory=pluginResult.message.isDirector';b.b.b+='y;entry.isFile=pluginResult.message.isFile;entry.name=pluginResult.message.name;entry.fullPath=pluginResult.message.fullPath;pluginResult.message=entry;return pluginResult};LocalFileSystem.prototype._castEntries=function(pluginResult){var entries=pluginResult.message;var retVal=[];for(i=0;i<entries.length;i++){retVal.push(window.localFileSystem._createEntry(entries[i]))}pluginResult.message=retVal;return pluginResult};LocalFileSystem.prototype._createEntry=function(castMe){var entry=null;if(castMe.isDirectory){entry=new DirectoryEntry()}else{if(castMe.isFile){entry=new FileEntry()}}entry.isDirectory=castMe.isDirectory;entry.isFile=castMe.isFile;entry.name=castMe.name;entry.fullPath=castMe.fullPath;return entry};LocalFileSystem.prototype._castDate=function(pluginResult){if(pluginResult.message.modificationTime){var metadataObj=new Metadata();metadataObj.modificationTime=new Date(pluginResult.message.modificationTime);pluginResult.message=metadataObj}else{if(pluginResult.message.lastModifiedDate){var file=new File();file.size=pluginResult.message.size;file.type=pluginResult.message.type;file.name=pluginResult.message.name;file.fullPath=pluginResult.message.fullPath;file.lastModifiedDate=new Date(pluginResult.message.lastModifiedDate);pluginResult.message=file}}return pluginResult};LocalFileSystem.prototype._castError=function(pluginResult){var fileError=new FileError();fileError.code=pluginResult.message;pluginResult.message=fileError;return pluginResult};Metadata=function(){this.modificationTime=null};Flags=function(create,exclusive){this.create=create||false;this.exclusive=exclusive||false};FileSystem=function(){this.name=null;this.root=null};DirectoryEntry=function(){this.isFile=false;this.isDirectory=true;this.name=null;this.fullPath=null;this.filesystem=null};DirectoryEntry.prototype.copyTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","copyTo",[this.fullPath,parent,newName])};DirectoryEntry.prototype.getMetadata=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getMetadata",[this.fullPath])};DirectoryEntry.prototype.getParent=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getParent",[this.fullPath])};DirectoryEntry.prototype.moveTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","moveTo",[this.fullPath,parent,newName])};DirectoryEntry.prototype.remove=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","remove",[this.fullPath])};DirectoryEntry.prototype.toURI=function(mimeType,successCallback,errorCallback){return"file://localhost"+this.fullPath};DirectoryEntry.prototype.createReader=function(successCallback,errorCallback){return new DirectoryReader(this.fullPath)};DirectoryEntry.prototype.getDirectory=function(path,options,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getDirectory",[this.fullPath,path,options])};DirectoryEntry.prototype.getFile=function(path,options,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getFile",[this.fullPath,path,options])};DirectoryEntry.prototype.removeRecursively=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","removeRecursively",[this.fullPath])};DirectoryReader=function(fullPath){this.fullPath=fullPath||null};DirectoryReader.prototype.readEntries=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","readEntries",[this.fullPath])};FileEntry=function(){this.isFile=true;this.isDirectory=false;this.name=null;this.fullPath=null;this.filesystem=null};FileEntry.prototype.copyTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","copyTo",[this.fullPath,parent,newName])};FileEntry.prototype.getMetadata=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getMetadata",[this.fullPath])};FileEntry.prototype.getParent=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getParent",[this.fullPath])};FileEntry.prototype.moveTo=function(parent,newName,successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","moveTo",[this.fullPath,parent,newName])};FileEntry.prototype.remove=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","remove",[this.fullPath])};FileEntry.prototype.toURI=function(mimeType,successCallback,errorCallback){return"file://localhost"+this.fullPath};FileEntry.prototype.createWriter=function(successCallback,errorCallback){this.file(function(filePointer){var writer=new FileWriter(filePointer);if(writer.fileName==null||writer.fileName==""){if(typeof errorCallback=="function"){errorCallback({code:FileError.INVALID_STATE_ERR})}}if(typeof successCallback=="function"){successCallback(writer)}},errorCallback)};FileEntry.prototype.file=function(successCallback,errorCallback){PhoneGap.exec(successCallback,errorCallback,"File","getFileMetadata",[this.fullPath])};PhoneGap.addConstructor(function(){var pgLocalFileSystem=new LocalFileSystem();if(typeof window.localFileSystem=="undefined"){window.localFileSystem=pgLocalFileSystem}if(typeof window.requestFileSystem=="undefined"){window.requestFileSystem=pgLocalFileSystem.requestFileSystem}if(typeof window.resolveLocalFileSystemURI=="undefined"){window.resolveLocalFileSystemURI=pgLocalFileSystem.resolveLocalFileSystemURI}})}if(!PhoneGap.hasResource("filetransfer")){PhoneGap.addResource("filetransfer");FileTransfer=function(){};FileUploadResult=function(){this.bytesSent=0;this.responseCode=null;this.response=null};FileTransferError=function(errorCode){this.code=errorCode||null};FileTransferError.FILE_NOT_FOUND_ERR=1;FileTransferError.INVALID_URL_ERR=2;FileTransferError.CONNECTION_ERR=3;FileTransfer.prototype.upload=function(filePath,server,successCallback,errorCallback,options){if(!options.params){options.params={}}options.filePath=filePath;options.server=server;if(!options.fileKey){options.fileKey="file"}if(!options.fileName){options.fileName="image.jpg"}if(!options.mimeType){options.mimeType="image/jpeg"}if(typeof successCallback!="function"){console.log("FileTransfer Error: successCallback is not a function");return}if(errorCallback&&(typeof errorCallback!="function")){console.log("FileTransfer Error: errorCallback is not a function");return}PhoneGap.exec(successCallback,errorCallback,"FileTransfer","upload",[options])};FileTransfer.prototype._castTransferError=function(pluginResult){var fileError=new FileTransferError(pluginResult.message);pluginResult.message=fileError;return pluginResult};FileTransfer.prototype._castUploadResult=function(pluginResult){var result=new FileUploadResult();result.bytesSent=pluginResult.message.bytesSent;result.responseCode=pluginResult.message.responseCode;result.response=decodeURIComponent(pluginResult.message.response);pluginResult.message=result;return pluginResult};FileUploadOptions=function(fileKey,fileName,mimeType,params){this.fileKey=fileKey||null;this.fileName=fileName||null;this.mimeType=mimeType||null;this.params=params||null};PhoneGap.addConstructor(function(){if(typeof navigator.fileTransfer=="undefined"){navigator.fileTransfer=new FileTransfer()}})}if(!PhoneGap.hasResource("geolocation")){PhoneGap.addResource("geolocation");Geolocation=function(){this.lastPosition=null;this.listener=null;this.timeoutTimerId=0};Geolocation.prototype.getCurrentPosition=function(successCallback,errorCallback,options){var win=successCallback;if(!win||typeof(win)!="function"){win=function(position){}}var fail=errorCallback;if(!fail||typeof(fail)!="function"){fail=function(positionError){}}var self=this;var totalTime=0;var timeoutTimerId;var params=new PositionOptions();if(options){if(options.maximumAge){if(this.lastPosition){var now=new Date().getTime();if(now-this.lastPosition.timestamp<options.maximumAge){win(this.lastPosition);return}}params.maximumAge=options.maximumAge}if(options.enableHighAccuracy){params.enableHighAccuracy=(options.enableHighAccuracy==true)}if(options.timeout){params.timeout=options.timeout}}this.listener={success:win,fail:fail};this.start(params);var onTimeout=function(){self.setError(new PositionError(PositionError.TIMEOUT,"Geolocation Error: Timeout."))};this.timeoutTimerId=setTimeout(onTimeout,params.timeout)};Geolocation.prototype.watchPosition=function(successCallback,errorCallback,options){var self=this;var params=new PositionOptions();if(options){if(options.maximumAge){params.maximumAge=options.maximumAge}if(options.enableHighAccuracy){params.enableHighAccuracy=options.enableHighAccuracy}if(options.timeout){params.timeout=options.timeout}}var that=this;var lastPos=that.lastPosition?that.lastPosition.clone():null;return setInterval(function(){var filterFun=function(position){if(lastPos==null||!position.equals(lastPos)){successCallback(position)}lastPos=position.clone()};that.getCurrentPosition(filterFun,errorCallback,params)},params.timeout)};Geolocation.prototype.clearWatch=function(watchId){clearInterval(watchId)};Geolocation.prototype.setLocation=function(position){var _position=new Position(position.coords,position.timestamp);if(this.timeoutTimerId){clearTimeout(this.timeoutTimerId);this.timeoutTimerId=0}this.lastError=null;this.lastPosition=_position;if(this.listener&&typeof(this.listener.success)=="function"){this.listener.success(_position)}this.listener=null};Geolocation.prototype.setError=function(error){var _error=new PositionError(error.code,error.message);if(this.timeoutTimerId){clearTimeout(this.timeoutTimerId);this.timeoutTimerId=0}this.lastError=_error;if(this.listener&&typeof(this.listener.fail)=="function"){this.listener.fail(_error)}this.listener=null};Geolocation.prototype.start=function(args){PhoneGap.exec("Location.startLocation",args)};Geolocation.prototype.stop=function(){PhoneGap.exec("Location.stopLocation")};PhoneGap.addConstructor(function(){if(typeof navigator._geo=="undefined"){var __proxyObj=function(origObj,proxyObj,funkList){var replaceFunk=function(org,proxy,fName){org[fName]=function(){return proxy[fName].apply(proxy,arguments)}};for(var v in funkList){replaceFunk(origObj,proxyObj,funkList[v])}};navigator._geo=new Geolocation();__proxyObj(navigator.geolocation,navigator._geo,["setLocation","getCurrentPosition","watchPosition","clearWatch","setError","start","stop"])}})}if(!PhoneGap.hasResource("compass")){PhoneGap.addResource("compass");Compass=function(){this.lastHeading=null;this.lastError=null;this.callbacks={onHeadingChanged:[],onError:[]}};Compass.prototype.getCurrentHeading=function(successCallback,errorCallback,options){if(this.lastHeading==null){this.callbacks.onHeadingChanged.push(successCallback);this.callbacks.onError.push(errorCallback);this.start(options)}else{if(options.maximumAge){var now=new Date().getTime();if(now-this.lastHeading.timestamp>options.maximumAge){this.callbacks.onHeadingChanged.push(successCallback);this.callbacks.onError.push(errorCallback);this.start(options);return}}if(typeof successCallback=="function"){var returnHeading=-1;if(this.lastHeading.trueHeading>-1){returnHeading=this.lastHeading.trueHeading}else{if(this.lastHeading.magneticHeading){returnHeading=this.lastHeading.magneticHeading}}successCallback(returnHeading)}}};Compass.prototype.watchHeading=function(successCallback,errorCallback,options){var frequency=(options&&options.frequency)?options.frequency:1000;var self=this;var funk=function(){self.getCurrentHeading(successCallback,errorCallback,options)};funk();return setInterval(funk,frequency)};Compass.prototype.clearWatch=function(watchId){clearInterval(watchId)};Compass.prototype.setHeading=function(heading){this.lastHeading=heading;var returnHeading=-1;if(this.lastHeading.trueHeading>-1){returnHeading=this.lastHeading.trueHeading}else{if(this.lastHeading.magneticHeading){returnHeading=this.lastHeading.magneticHeading}}var arr=this.callbacks.onHeadingChanged;for(var i=0,len=arr.length;i<len;i++){arr[i](returnHeading)}this.callbacks.onHeadingChanged=[];this.callbacks.onError=[]};Compass.prototype.setError=function(message){this.lastError=message;var arr=this.callbacks.onError;for(var i=0,len=arr.length;i<len;i++){arr[i](message)}this.callbacks.onHeadingChanged=[];this.callbacks.onError=[];this.stop()};Compass.prototype.start=function(args){PhoneGap.exec("Location.startHeading",args)};Compass.prototype.stop=function(){PhoneGap.exec("Location.stopHeading")};PhoneGap.addConstructor(function(){if(typeof navigator.compass=="undefined"){navigator.compass=new Compass()}})}if(!PhoneGap.hasResource("media")){PhoneGap.addResource("media");Media=function(src,successCallback,errorCallback,downloadCompleteCallback){if(!src){src="documents://"+String((new Date()).getTime()).replace(/\\D/gi,"")}this.src=src;var successCB=(successCallback==undefined||successCallback==null)?null:GetFunctionName(successCallback);var errorCB=(errorCallback==undefined||errorCallback==null)?null:GetFunctionName(errorCallback);var downloadCB=(downloadCompleteCallback==undefined||downloadCompleteCallback==null)?null:GetFunctionName(downloadCompleteCallback);this.successCallback=successCallback||null;this.errorCallback=errorCallback||null;this.downloadCompleteCallback=downloadCompleteCallback||null;if(this.src!=null){PhoneGap.exec("Sound.prepare",this.src,successCB,errorCB,downloadCB)}};Media.prototype.play=function(options){if(this.src!=null){PhoneGap.exec("Sound.play",this.src,options)}};Media.prototype.pause=function(){if(this.src!=null){PhoneGap.exec("Sound.pause",this.src)}};Media.prototype.stop=function(){if(this.src!=null){PhoneGap.exec("Sound.stop",this.src)}};Media.prototype.startAudioRecord=function(options){if(this.src!=null){PhoneGap.exec("Sound.startAudioRecord",this.src,options)}};Media.prototype.stopAudioRecord=function(){if(this.src!=null){PhoneGap.exec("Sound.stopAudioRecord",this.src)}};MediaError=function(){this.code=null,this.message=""};MediaError.MEDIA_ERR_ABORTED=1;MediaError.MEDIA_ERR_NETWORK=2;MediaError.MEDIA_ERR_DECODE=3;MediaError.MEDIA_ERR_NONE_SUPPORTED=4}if(!PhoneGap.hasResource("notification")){PhoneGap.addResource("notification");Notification=function(){};Notification.prototype.alert=function(message,completeCallback,title,buttonLabel){var _title=(title||"Alert");var _buttonLabel=(buttonLabel||"OK");PhoneGap.exec(completeCallback,null,"Notification","alert",[message,{title:_title,buttonLabel:_buttonLabel}])};Notification.prototype.confirm=function(message,resultCallback,title,buttonLabels){var _title=(title||"Confirm");var _buttonLabels=(buttonLabels||"OK,Cancel");this.alert(message,resultCallback,_title,_buttonLabels)};Notification.prototype.activityStart=function(){console.warn("Notification.activityStart is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");PhoneGap.exec(null,null,"Notification","activityStart",[])};Notification.prototype.activityStop=function(){console.warn("Notification.activityStop is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");PhoneGap.exec(null,null,"Notification","activityStop",[])};Notification.prototype.loadingStart=function(options){console.warn("Notification.loadingStart is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");PhoneGap.exec(null,null,"Notification","loadingStart",[options])};Notification.prototype.loadingStop=function(){console.warn("Notification.loadingStop is deprecated and will be removed in 1.0. It will be moved to the plugins repo.");PhoneGap.exec(null,null,"Notification","loadingStop",[])};Notification.prototype.blink=function(count,colour){};Notification.prototype.vibrate=function(mills){PhoneGap.exec(null,null,"Notification","vibrate",[])};Notification.prototype.beep=function(count,volume){new Media("beep.wav").play()};PhoneGap.addConstructor(function(){if(typeof navigator.notification=="undefined"){navigator.notification=new Notification()}})}if(!PhoneGap.hasResource("orientation")){PhoneGap.addResource("orientation");Orientation=function(){this.currentOrientation=null};Orientation.prototype.setOrientation=function(orientation){Orientation.currentOrientation=orientation;var e=document.createEvent("Events");e.initEvent("orientationChanged","false","';b.b.b+='false");e.orientation=orientation;document.dispatchEvent(e)};Orientation.prototype.getCurrentOrientation=function(successCallback,errorCallback){};Orientation.prototype.watchOrientation=function(successCallback,errorCallback){this.getCurrentPosition(successCallback,errorCallback);return setInterval(function(){navigator.orientation.getCurrentOrientation(successCallback,errorCallback)},10000)};Orientation.prototype.clearWatch=function(watchId){clearInterval(watchId)};Orientation.install=function(){if(typeof navigator.orientation=="undefined"){navigator.orientation=new Orientation()}var windowDispatchAvailable=!(window.dispatchEvent===undefined);if(windowDispatchAvailable){return}var self=this;var orientationchangeEvent="orientationchange";var newOrientationchangeEvent="orientationchange_pg";var _addEventListener=window.addEventListener;var _removeEventListener=window.removeEventListener;window.onorientationchange=function(){PhoneGap.fireEvent(newOrientationchangeEvent,window)};window.addEventListener=function(){if(arguments[0]===orientationchangeEvent){arguments[0]=newOrientationchangeEvent}if(!windowDispatchAvailable){return document.addEventListener.apply(this,arguments)}else{return _addEventListener.apply(this,arguments)}};window.removeEventListener=function(){if(arguments[0]===orientationchangeEvent){arguments[0]=newOrientationchangeEvent}if(!windowDispatchAvailable){return document.removeEventListener.apply(this,arguments)}else{return _removeEventListener.apply(this,arguments)}}};PhoneGap.addConstructor(Orientation.install)}if(!PhoneGap.hasResource("sms")){PhoneGap.addResource("sms");Sms=function(){};Sms.prototype.send=function(number,message,successCallback,errorCallback,options){};PhoneGap.addConstructor(function(){if(typeof navigator.sms=="undefined"){navigator.sms=new Sms()}})}if(!PhoneGap.hasResource("telephony")){PhoneGap.addResource("telephony");Telephony=function(){};Telephony.prototype.call=function(number){};PhoneGap.addConstructor(function(){if(typeof navigator.telephony=="undefined"){navigator.telephony=new Telephony()}})}if(!PhoneGap.hasResource("network")){PhoneGap.addResource("network");Connection=function(){this.type=Connection.UNKNOWN;try{this.type=DeviceInfo.connection.type}catch(e){}};Connection.UNKNOWN="unknown";Connection.ETHERNET="ethernet";Connection.WIFI="wifi";Connection.CELL_2G="2g";Connection.CELL_3G="3g";Connection.CELL_4G="4g";Connection.NONE="none";NetworkStatus=function(){this.code=null;this.message=""};NetworkStatus.NOT_REACHABLE=0;NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK=1;NetworkStatus.REACHABLE_VIA_WIFI_NETWORK=2;Network=function(){};Network.prototype.isReachable=function(hostName,successCallback,options){console.warn("Network.isReachable is deprecated and will be removed in 1.0. Please use the Network Information API instead.");PhoneGap.exec("Network.isReachable",hostName,GetFunctionName(successCallback),options)};PhoneGap.addConstructor(function(){if(typeof navigator.network=="undefined"){navigator.network=new Network()}if(typeof navigator.network.connection=="undefined"){navigator.network.connection=new Connection()}})};';return b.b.b};
--></script>
<script><!--
_.cM={};_=Pp.prototype=Mp.prototype=new v;_.gC=function Qp(){return ui};_.cM={};_=Sp.prototype=Rp.prototype=new v;_.gC=function Tp(){return vi};_.cM={};_.b=0;_.c=0;_.d=null;_.e=null;_.f=null;_=Zp.prototype=Yp.prototype=Up.prototype=new v;_.eQ=function $p(b){var c;if(!(b!=null&&b.cM&&!!b.cM[22])){return false}c=Ng(b,22);return this.b==c.b&&this.c==c.c};_.gC=function _p(){return wi};_.hC=function aq(){return ~~Math.max(Math.min(this.b,2147483647),-2147483648)^~~Math.max(Math.min(this.c,2147483647),-2147483648)};_.tS=function bq(){return 'Point('+this.b+','+this.c+gB};_.cM={22:1};_.b=0;_.c=0;_=pq.prototype=cq.prototype=new v;_.gC=function qq(){return Fi};_.cM={};_.b=null;_.c=false;_.f=null;_.g=null;_.j=null;_.k=null;_.n=null;_.o=false;_.p=null;var dq=null;_=sq.prototype=rq.prototype=new v;_.gC=function tq(){return xi};_.cM={14:1,28:1};_.b=null;_=vq.prototype=uq.prototype=new v;_.gC=function wq(){return yi};_.cM={13:1,28:1};_.b=null;_=yq.prototype=xq.prototype=new v;_.gC=function zq(){return zi};_.cM={11:1,12:1,28:1};_.b=null;_=Bq.prototype=Aq.prototype=new v;_.gC=function Cq(){return Ai};_.cM={9:1,10:1,28:1};_.b=null;_=Eq.prototype=Dq.prototype=new v;_.gC=function Fq(){return Bi};_.fb=function Gq(b){if(1==Pr(b.e.type)){b.e.stopPropagation();b.e.preventDefault();lq(this.b,false)}};_.cM={24:1,28:1};_.b=null;_=Kq.prototype=Hq.prototype=new v;_.gC=function Lq(){return Di};_.cM={};_.d=0;_.e=null;_.f=null;_.g=null;_=Nq.prototype=Mq.prototype=new v;_.gC=function Oq(){return Ci};_.N=function Pq(b){Jq(this.b)};_.cM={16:1,28:1};_.b=null;_=Tq.prototype=Sq.prototype=Qq.prototype=new v;_.gC=function Uq(){return Ei};_.cM={};_.b=null;_.c=0;var Vq=null,Wq=null;var ar=null;_=gr.prototype=cr.prototype=new Hd;_.F=function hr(b){Ng(b,24).fb(this);er.d=false};_.G=function jr(){return dr};_.gC=function kr(){return Gi};_.H=function lr(){fr(this)};_.cM={};_.b=false;_.c=false;_.d=false;_.e=null;var dr=null,er=null;var mr=null;var qr=false,rr=null,sr=0,tr=0,ur=false;_=Fr.prototype=Cr.prototype=new Hd;_.F=function Gr(b){Rg(b);null.Db()};_.G=function Hr(){return Dr};_.gC=function Ir(){return Hi};_.cM={};var Dr;var Jr=null;_=Mr.prototype=Lr.prototype=new Jf;_.gC=function Nr(){return Ii};_.cM={38:1};var Or=false;var Sr=null,Tr=null,Ur=null,Vr=null,Wr=null;_=Zr.prototype=new v;_.gb=function as(b){return decodeURI(b.replace('%23','#'))};_.O=function bs(b){Kf(this.b,b)};_.gC=function cs(){return Li};_.hb=function ds(b){b=b==null?EA:b;if(!mw(b,$r==null?EA:$r)){$r=b;Gf(this)}};_.cM={38:1};var $r=EA;_=fs.prototype=new Zr;_.gC=function hs(){return Ki};_.cM={38:1};_=is.prototype=es.prototype=new fs;_.gC=function js(){return Ji};_.cM={38:1};_=ns.prototype=new $l;_.gC=function qs(){return Ti};_.Z=function rs(){return new dv(this.g)};_.X=function ss(b){return ps(this,b)};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=ms.prototype=new ns;_.gC=function zs(){return Mi};_.X=function As(b){var c;return c=ps(this,b),c&&ys(b.z),c};_.ib=function Bs(b,c,d){xs(b,c,d)};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=Gs.prototype=Cs.prototype=new hg;_.gC=function Hs(){return Pi};_.cM={2:1,3:1,18:1,44:1};var Ds,Es;_=Ks.prototype=Js.prototype=new v;_.jb=function Ls(b){b.U()};_.gC=function Ms(){return Ni};_.cM={};_=Os.prototype=Ns.prototype=new v;_.jb=function Ps(b){hm(b)};_.gC=function Qs(){return Oi};_.cM={};_=Ts.prototype=new _l;_.gC=function Us(){return Vi};_.U=function Vs(){var b;gm(this);b=gc(this.z);-1==b&&(this.z.tabIndex=0,undefined)};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=Ss.prototype=new Ts;_.gC=function Ws(){return Qi};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=Xs.prototype=Rs.prototype=new Ss;_.gC=function Ys(){return Ri};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=Zs.prototype=new ns;_.gC=function _s(){return Si};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.e=null;_.f=null;_=ct.prototype=at.prototype=new v;_.gC=function dt(){return Ui};_.cM={};_.b=null;_.c=null;_.d=null;_=gt.prototype=new _l;_.gC=function kt(){return _i};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.b=null;_.c=null;_.d=null;_=lt.prototype=ft.prototype=new gt;_.gC=function nt(){return aj};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=ot.prototype=et.prototype=new ft;_.gC=function pt(){return Wi};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};var qt;var st,tt,ut,vt,wt;_=zt.prototype=yt.prototype=new v;_.gC=function At(){return Xi};_.cM={};_=Ct.prototype=Bt.prototype=new yt;_.gC=function Et(){return Yi};_.cM={};_.b=null;var Gt,Ht;_=Kt.prototype=Jt.prototype=new v;_.gC=function Lt(){return Zi};_.cM={};_.b=null;_=Pt.prototype=Mt.prototype=new Zs;_.gC=function Qt(){return $i};_.X=function Rt(b){var c,d,e;d=(e=b.z.parentNode,(!e||e.nodeType!=1)&&(e=null),e);c=ps(this,b);c&&this.c.removeChild(d);return c};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_.c=null;_=Ut.prototype=St.prototype=new v;_.gC=function Vt(){return cj};_.N=function Wt(b){Tt()};_.cM={16:1,28:1};_=Yt.prototype=Xt.prototype=new v;_.gC=function Zt(){return dj};_.fb=function $t(b){Dm(this.b,b)};_.cM={24:1,28:1};_.b=null;_=au.prototype=_t.prototype=new v;_.gC=function bu(){return ej};_.cM={17:1,28:1};_.b=null;_=hu.prototype=cu.prototype=new u;_.gC=function iu(){return fj};_.cM={};_.b=null;_.c=false;_.d=false;_.e=null;_.f=false;_=ju.prototype=new ms;_.gC=function su(){return kj};_.cM={25:1,26:1,27:1,37:1,38:1,42:1,43:1};var ku,lu,mu;_=uu.prototype=tu.prototype=new v;_.jb=function vu(b){b.v&&hm(b)};_.gC=function wu(){return hj};_.cM={};_=yu.prototype=xu.prototype=new v;_.gC=function zu(){return ij};_.cM={15:1,28:1};_=Bu.prototype=Au.prototype=new ju;_.gC=function Cu(){return jj};_.ib=function Du(b,c,d){c-=kc($doc);d-=lc($doc);xs(b,c,d)};_.cM={25:1,26:1,27:1,37:1,38:1,42:1,43:1};_=Gu.prototype=Eu.prototype=new v;_.gC=function Hu(){return lj};_.cM={};_=Ku.prototype=Iu.prototype=new v;_.gC=function Lu(){return nj};_.kb=function Mu(){return this.b};_.lb=function Nu(){return Ju(this)};_.mb=function Ou(){!!this.c&&vm(this.d,this.c)};_.cM={};_.c=null;_.d=null;_=Ru.prototype=Pu.prototype=new Zs;_.gC=function Su(){return qj};_.X=function Tu(b){var c,d,e;d=(e=b.z.parentNode,(!e||e.nodeType!=1)&&(e=null),e);c=ps(this,b);c&&this.e.removeChild(cc(d));return c};_.cM={25:1,26:1,37:1,38:1,42:1,43:1};_=$u.prototype=Uu.prototype=new v;_.gC=function _u(){return sj};_.Z=function av(){return new dv(this)};_.cM={};_.b=null;_.c=null;_.d=0;_=dv.prototype=bv.prototype=new v;_.gC=function ev(){return rj};_.kb=function fv(){return this.b<this.c.d-1};_.lb=function gv(){return cv(this)};_.mb=function hv(){if(this.b<0||this.b>=this.c.d){throw new Uv}this.c.c.X(this.c.b[this.b--])};_.cM={};_.b=-1;_.c=null;_=kv.prototype=iv.prototype=new v;_.gC=function lv(){return xj};_.cM={};_.b=null;_.c=null;_.d=null;_.e=null;_=nv.prototype=mv.prototype=new v;_.nb=function ov(){Vf(this.b,this.d,this.c)};_.gC=function pv(){return yj};_.cM={31:1};_.b=null;_.c=null;_.d=null;_=rv.prototype=qv.prototype=new v;_.nb=function sv(){Xf(this.b,this.d,this.c)};_.gC=function tv(){return zj};_.cM={31:1};_.b=null;_.c=null;_.d=null;_=vv.prototype=uv.prototype=new I;_.gC=function wv(){return Cj};_.cM={2:1,3:1,44:1};_=Bv.prototype=xv.prototype=new v;_.eQ=function Cv(b){return b!=null&&b.cM&&!!b.cM[33]&&Ng(b,33).b==this.b};_.gC=function Dv(){return Dj};_.hC=function Ev(){return this.b?1231:1237};_.tS=function Fv(){return this.b?'true':'false'};_.cM={33:1,44:1,46:1};_.b=false;var yv,zv;_=Hv.prototype=Gv.prototype=new v;_.gC=function Lv(){return Fj};_.tS=function Mv(){return ((this.b&2)!=0?'interface ':(this.b&1)!=0?EA:'class ')+this.c};_.cM={};_.b=0;_.c=null;_=Ov.prototype=Nv.prototype=new I;_.gC=function Pv(){return Ej};_.cM={2:1,3:1,44:1};_=Rv.prototype=Qv.prototype=new I;_.gC=function Sv(){return Ij};_.cM={2:1,3:1,44:1};_=Vv.prototype=Uv.prototype=Tv.prototype=new I;_.gC=function Wv(){return Jj};_.cM={2:1,3:1,44:1};_=Zv.prototype=Yv.prototype=Xv.prototype=new I;_.gC=function $v(){return Kj};_.cM={2:1,3:1,44:1};_=ew.prototype=dw.prototype=cw.prototype=new I;_.gC=function fw(){return Lj};_.cM={2:1,3:1,44:1};var gw;_=jw.prototype=iw.prototype=new v;_.gC=function kw(){return Oj};_.tS=function lw(){return this.b+eB+this.d+fB+(this.c>=0?JA+this.c:EA)+gB};_.cM={44:1,48:1};_.b=null;_.c=0;_.d=null;_=String.prototype;_.eQ=function uw(b){return mw(this,b)};_.gC=function vw(){return Rj};_.hC=function ww(){return Dw(this)};_.tS=function xw(){return this};_.cM={1:1,44:1,45:1,46:1};var yw,zw=0,Aw;_=Iw.prototype=Hw.prototype=Fw.prototype=new v;_.gC=function Jw(){return Pj};_.tS=function Kw(){return this.b.b};_.cM={45:1};_=Ow.prototype=Nw.prototype=Lw.prototype=new v;_.gC=function Pw(){return Qj};_.tS=function Qw(){return this.b.b};_.cM={45:1};_=Sw.prototype=Rw.prototype=new I;_.gC=function Tw(){return Tj};_.cM={2:1,3:1,44:1};_=Uw.prototype=new v;_.ob=function Xw(b){throw new Sw('Add not supported on this collection')};_.pb=function Yw(b){var c;c=Vw(this.Z(),b);return !!c};_.gC=function Zw(){return Uj};_.qb=function $w(){return this.sb()==0};_.rb=function _w(b){var c;c=Vw(this.Z(),b);if(c){c.mb();return true}else{return false}};_.tb=function ax(b){var c,d,e;e=this.sb();b.length<e&&(b=Bg(b,e));d=this.Z();for(c=0;c<e;++c){Gg(b,c,d.lb())}b.length>e&&Gg(b,e,null);return b};_.tS=function bx(){return Ww(this)};_.cM={};_=dx.prototype=new v;_.eQ=function fx(b){var c,d,e,f,g;if(b===this){return true}if(!(b!=null&&b.cM&&!!b.cM[29])){return false}f=Ng(b,29);if(this.e!=f.e){return false}for(d=new Qx((new Hx(f)).b);xy(d.b);){c=d.c=Ng(yy(d.b),49);e=c.vb();g=c.wb();if(!(e==null?this.d:e!=null&&e.cM&&!!e.cM[1]?JA+Ng(e,1) in this.f:px(this,e,~~bb(e)))){return false}if(!bA(g,e==null?this.c:e!=null&&e.cM&&!!e.cM[1]?this.f[JA+Ng(e,1)]:ox(this,e,~~bb(e)))){return false}}return true};_.gC=function gx(){return ek};_.hC=function hx(){var b,c,d;d=0;for(c=new Qx((new Hx(this)).b);xy(c.b);){b=c.c=Ng(yy(c.b),49);d+=b.hC();d=~~d}return d};_.tS=function ix(){var b,c,d,e;e='{';b=false;for(d=new Qx((new Hx(this)).b);xy(d.b);){c=d.c=Ng(yy(d.b),49);b?(e+=XB):(b=true);e+=EA+c.vb();e+=CB;e+=EA+c.wb()}return e+'}'};_.cM={29:1};_=cx.prototype=new dx;_.ub=function zx(b,c){return (b==null?null:b)===(c==null?null:c)||b!=null&&ab(b,c)};_.gC=function Ax(){return Zj};_.cM={29:1};_.b=null;_.c=null;_.d=false;_.e=0;_.f=null;_=Cx.prototype=new Uw;_.eQ=function Dx(b){var c,d,e;if(b===this){return true}if(!(b!=null&&b.cM&&!!b.cM[50])){return false}d=Ng(b,50);if(d.sb()!=this.sb()){return false}for(c=d.Z();c.kb();){e=c.lb();if(!this.pb(e)){return false}}return true};_.gC=function Ex(){return fk};_.hC=function Fx(){var b,c,d;b=0;for(c=this.Z();c.kb();){d=c.lb();if(d!=null){b+=bb(d);b=~~b}}return b};_.cM={50:1};_=Hx.prototype=Bx.prototype=new Cx;_.pb=function Ix(b){return Gx(this,b)};_.gC=function Jx(){return Wj};_.Z=function Kx(){return new Qx(this.b)};_.rb=function Lx(b){var c;if(Gx(this,b)){c=Ng(b,49).vb();vx(this.b,c);return true}return false};_.sb=function Mx(){return this.b.e};_.cM={50:1};_.b=null;_=Qx.prototype=Nx.prototype=new v;_.gC=function Rx(){return Vj};_.kb=function Sx(){return xy(this.b)};_.lb=function Tx(){return this.c=Ng(yy(this.b),49)};_.mb=function Ux(){Px(this)};_.cM={};_.b=null;_.c=null;_.d=null;_=Wx.prototype=new v;_.eQ=function Xx(b){var c;if(b!=null&&b.cM&&!!b.cM[49]){c=Ng(b,49);if(bA(this.vb(),c.vb())&&bA(this.wb(),c.wb())){return true}}return false};_.gC=function Yx(){return dk};_.hC=function Zx(){var b,c;b=0;c=0;this.vb()!=null&&(b=bb(this.vb()));this.wb()!=null&&(c=bb(this.wb()));return b^c};_.tS=function $x(){return this.vb()+CB+this.wb()};_.cM={49:1};_=_x.prototype=Vx.prototype=new Wx;_.gC=function ay(){return Xj};_.vb=function by(){return null};_.wb=function cy(){return this.b.c};_.xb=function dy(b){return tx(this.b,b)};_.cM={49:1};_.b=null;_=fy.prototype=ey.prototype=new Wx;_.gC=function gy(){return Yj};_.vb=function hy(){return this.b};_.wb=function iy(){return this.c.f[JA+this.b]};_.xb=function jy(b){return ux(this.c,this.b,b)};_.cM={49:1};_.b=null;_.c=null;_=ky.prototype=new Uw;_.ob=function ly(b){this.yb(this.sb(),b);return true};_.yb=function my(b,c){throw new Sw('Add not supported on this list')};_.eQ=function oy(b){var c,d,e,f,g;if(b===this){return true}if(!(b!=null&&b.cM&&!!b.cM[30])){return false}g=Ng(b,30);if(this.sb()!=g.sb()){return false}e=new Ay(this);f=g.Z();while(e.c<e.e.sb()){c=yy(e);d=yy(f);if(!(c==null?d==null:ab(c,d))){return false}}return true};_.gC=function py(){return ak};_.hC=function qy(){var b,c,d;c=1;b=new Ay(this);while(b.c<b.e.sb()){d=yy(b);c=31*c+(d==null?0:bb(d));c=~~c}return c};_.Z=function sy(){return new Ay(this)};_.Ab=function ty(){return new Hy(this,0)};_.Bb=function uy(b){return new Hy(this,b)};_.Cb=function vy(b){throw new Sw('Remove not supported on this list')};_.cM={30:1};_=Ay.prototype=wy.prototype=new v;_.gC=function By(){return $j};_.kb=function Cy(){return this.c<this.e.sb()};_.lb=function Dy(){return yy(this)};_.mb=function Ey(){zy(this)};_.cM={};_.c=0;_.d=-1;_.e=null;_=Hy.prototype=Fy.prototype=new wy;_.gC=function Iy(){return _j};_.cM={};_.b=null;_=Ky.prototype=Jy.prototype=new Cx;_.pb=function Ly(b){return mx(this.b,b)};_.gC=function My(){return ck};_.Z=function Ny(){var b;return b=new Qx(this.c.b),new Qy(b)};_.sb=function Oy(){return this.c.b.e};_.cM={50:1};_.b=null;_.c=null;_=Qy.prototype=Py.prototype=new v;_.gC=function Ry(){return bk};_.kb=function Sy(){return xy(this.b.b)};_.lb=function Ty(){var b;b=Ox(this.b);return b.vb()};_.mb=function Uy(){Px(this.b)};_.cM={};_.b=null;_=az.prototype=Vy.prototype=new ky;_.ob=function bz(b){return Gg(this.b,this.c++,b),true};_.yb=function cz(b,c){(b<0||b>this.c)&&ry(b,this.c);this.b.splice(b,0,c);++this.c};_.pb=function dz(b){return Yy(this,b,0)!=-1};_.zb=function ez(b){return ny(b,this.c),this.b[b]};_.gC=function fz(){return gk};_.qb=function gz(){return this.c==0};_.Cb=function hz(b){return Zy(this,b)};_.rb=function iz(b){return $y(this,b)};_.sb=function jz(){return this.c};_.tb=function kz(b){return _y(this,b)};_.cM={30:1,44:1};_.c=0;var lz;_=oz.prototype=nz.prototype=new ky;_.pb=function pz(b){return false};_.zb=function qz(b){throw new Yv};_.gC=function rz(){return hk};_.sb=function sz(){return 0};_.cM={30:1,44:1};_=wz.prototype=vz.prototype=tz.prototype=new v;_.eQ=function xz(b){return b!=null&&b.cM&&!!b.cM[51]&&Pk(Qk(this.b.getTime()),Qk(Ng(b,51).b.getTime()))};_.gC=function yz(){return ik};_.hC=function zz(){var b;b=Qk(this.b.getTime());return Vk(Wk(b,Tk(b,32)))};_.tS=function Bz(){return uz(this)};_.cM={44:1,46:1,51:1};_.b=null;var Cz,Dz;_=Hz.prototype=Fz.prototype=new cx;_.gC=function Iz(){return jk};_.cM={29:1,44:1};_=Lz.prototype=Jz.prototype=new Cx;_.ob=function Mz(b){var c;return c=rx(this.b,b,this),c==null};_.pb=function Nz(b){return mx(this.b,b)};_.gC=function Oz(){return kk};_.qb=function Pz(){return this.b.e==0};_.Z=function Qz(){var b;return b=new Qx(ex(this.b).c.b),new Qy(b)};_.rb=function Rz(b){return vx(this.b,b)!=null};_.sb=function Sz(){return this.b.e};_.tS=function Tz(){return Ww(ex(this.b))};_.cM={44:1,50:1};_.b=null;_=Vz.prototype=Uz.prototype=new Wx;_.gC=function Wz(){return lk};_.vb=function Xz(){return this.b};_.wb=function Yz(){return this.c};_.xb=function Zz(b){var c;c=this.c;this.c=b;return c};_.cM={49:1};_.b=null;_.c=null;_=_z.prototype=$z.prototype=new I;_.gC=function aA(){return mk};_.cM={2:1,3:1,44:1};_=hA.prototype=cA.prototype=new v;_.gC=function iA(){return rk};_.cM={};_.b=null;_.c=null;var dA=null;_=kA.prototype=jA.prototype=new po;_.gC=function lA(){return qk};_.cM={20:1};_=nA.prototype=mA.prototype=new v;_.gC=function oA(){return sk};_.cM={44:1};_.b=null;_.c=EA;_.d=BA;_.e=null;_.f=null;var pA;_=tA.prototype=sA.prototype=new v;_.gC=function uA(){return uk};_.ab=function vA(){$wnd.navigator.notification.vibrate(250)};_.cM={};_=xA.prototype=wA.prototype=new v;_.gC=function yA(){return vk};_.J=function zA(b){$wnd.navigator.notification.beep(1);Qo('It works!',new tA,xB,'OK')};_.cM={4:1,28:1};var CA=ib;var Mj=Jv(YB,'Object'),Sg=Jv('com.google.gwt.animation.client.','Animation'),Gj=Jv(YB,'Enum'),Tg=Jv(ZB,'Duration'),Sj=Jv(YB,'Throwable'),Hj=Jv(YB,'Exception'),Nj=Jv(YB,'RuntimeException'),Ug=Jv(ZB,'JavaScriptException'),Vg=Jv(ZB,'JavaScriptObject$'),Wg=Jv(ZB,'Scheduler'),Xg=Jv($B,'SchedulerImpl'),$g=Jv($B,'StackTraceCreator$Collector'),Oj=Jv(YB,'StackTraceElement'),Ek=Iv(_B,'StackTraceElement;'),Zg=Jv($B,'StackTraceCreator$CollectorMoz'),Yg=Jv($B,'StackTraceCreator$CollectorChrome'),ah=Jv($B,'StringBufferImpl'),_g=Jv($B,'StringBufferImplAppend'),Rj=Jv(YB,FA),Fk=Iv(_B,'String;'),fh=Kv(aC,'Style$Display',Dc),xk=Iv(bC,'Style$Display;'),bh=Kv(aC,'Style$Display$1',null),ch=Kv(aC,'Style$Display$2',null),dh=Kv(aC,'Style$Display$3',null),eh=Kv(aC,'Style$Display$4',null),ph=Kv(aC,'Style$Unit',bd),yk=Iv(bC,'Style$Unit;'),gh=Kv(aC,'Style$Unit$1',null),hh=Kv(aC,'Style$Unit$2',null),ih=Kv(aC,'Style$Unit$3',null),jh=Kv(aC,'Style$Unit$4',null),kh=Kv(aC,'Style$Unit$5',null),lh=Kv(aC,'Style$Unit$6',null),mh=Kv(aC,'Style$Unit$7',null),nh=Kv(aC,'Style$Unit$8',null),oh=Kv(aC,'Style$Unit$9',null),wj=Jv(cC,'Event'),Jh=Jv(dC,'GwtEvent'),sh=Jv(eC,'DomEvent'),th=Jv(eC,'HumanInputEvent'),vh=Jv(eC,'MouseEvent'),qh=Jv(eC,'ClickEvent'),uj=Jv(cC,'Event$Type'),Ih=Jv(dC,'GwtEvent$Type'),rh=Jv(eC,'DomEvent$Type'),uh=Jv(eC,'MouseDownEvent'),wh=Jv(eC,'MouseMoveEvent'),xh=Jv(eC,'MouseUpEvent'),yh=Jv(eC,'PrivateMap'),Ch=Jv(eC,'TouchEvent'),zh=Jv(eC,'TouchCancelEvent'),Ah=Jv(eC,'TouchEndEvent'),Bh=Jv(eC,'TouchEvent$TouchSupportDetector'),Dh=Jv(eC,'TouchMoveEvent'),Eh=Jv(eC,'TouchStartEvent'),Fh=Jv(fC,'CloseEvent'),Gh=Jv(fC,'ResizeEvent'),Hh=Jv(fC,'ValueChangeEvent'),Lh=Jv(dC,'HandlerManager'),vj=Jv(cC,'EventBus'),Aj=Jv(cC,'SimpleEventBus'),Kh=Jv(dC,'HandlerManager$Bus'),Mh=Jv(dC,'LegacyHandlerWrapper'),Bj=Jv(cC,gC),Nh=Jv(dC,gC),Oh=Kv('com.google.gwt.i18n.client.','HasDirection$Direction',yg),zk=Iv('[Lcom.google.gwt.i18n.client.','HasDirection$Direction;'),Ph=Jv('com.google.gwt.lang.','LongLibBase$LongEmul'),Ak=Iv('[Lcom.google.gwt.lang.','LongLibBase$LongEmul;'),ok=Jv(hC,'Handler'),Qh=Jv(iC,'ConsoleLogHandler'),Rh=Jv(iC,'DevelopmentModeLogHandler'),Sh=Jv(iC,'FirebugLogHandler'),Th=Jv(iC,'HasWidgetsLogHandler'),nk=Jv(hC,'Formatter'),fi=Jv(jC,'FormatterImpl'),Uh=Jv(iC,'HtmlLogFormatter'),Xh=Jv(iC,'LogConfiguration'),Vh=Jv(iC,'LogConfiguration$1'),Wh=Jv(iC,'LogConfiguration$LogConfigurationImplRegular'),pj=Jv(kC,'UIObject'),tj=Jv(kC,'Widget'),bj=Jv(kC,'Panel'),oj=Jv(kC,'SimplePanel'),gj=Jv(kC,'PopupPanel'),bi=Jv(iC,'LoggingPopup'),Yh=Jv(iC,'LoggingPopup$1'),Zh=Jv(iC,'LoggingPopup$MouseDragHandler'),mj=Jv(kC,'ScrollPanel'),$h=Jv(iC,'LoggingPopup$ScrollPanelWithMinSize'),_h=Jv(iC,'LoggingPopup$WindowMoveHandler'),ai=Jv(iC,'LoggingPopup$WindowResizeHandler'),ci=Jv(iC,'NullLogHandler'),di=Jv(iC,'SystemLogHandler'),ei=Jv(iC,'TextLogFormatter'),hi=Jv(jC,'LevelImplRegular'),pk=Jv(hC,'Level'),gi=Jv(jC,'LevelImplRegular$LevelWithExposedConstructor'),ii=Jv(jC,'LoggerImplRegular'),tk=Jv(hC,'Logger'),ji=Jv(jC,'LoggerWithExposedConstructor'),Kj=Jv(YB,'IndexOutOfBoundsException'),Cj=Jv(YB,'ArrayStoreException'),Dj=Jv(YB,'Boolean'),Ej=Jv(YB,'ClassCastException'),Ij=Jv(YB,'IllegalArgumentException'),Jj=Jv(YB,'IllegalStateException'),Lj=Jv(YB,'NullPointerException'),Tj=Jv(YB,'UnsupportedOperationException'),Uj=Jv(lC,'AbstractCollection'),fk=Jv(lC,'AbstractSet'),kk=Jv(lC,'HashSet'),mk=Jv(lC,'NoSuchElementException'),ek=Jv(lC,'AbstractMap'),sk=Jv(hC,'LogRecord'),ki=Kv(mC,'DeviceType',Do),Bk=Iv('[Lcom.google.gwt.mobile.phonegap.','DeviceType;'),li=Jv(mC,'PhoneGap$1'),mi=Jv('com.google.gwt.mobile.phonegap.factory.','PhoneGapNativeImplBase'),ni=Jv(nC,'PhoneGapNativeImplAndroid'),oi=Jv(nC,'PhoneGapNativeImplDefault'),pi=Jv(nC,'PhoneGapNativeImplIos'),qi=Jv(oC,'Resources_default_InlineClientBundleGenerator$1'),ri=Jv(oC,'Resources_default_InlineClientBundleGenerator$2'),si=Jv(oC,'Resources_default_InlineClientBundleGenerator$3'),ti=Jv(oC,'Resources_default_InlineClientBundleGenerator$4'),ui=Jv(pC,'DefaultMomentum'),vi=Jv(pC,'Momentum$State'),wi=Jv(pC,'Point'),Fi=Jv(pC,'TouchScroller'),xi=Jv(pC,'TouchScroller$1'),yi=Jv(pC,'TouchScroller$2'),zi=Jv(pC,'TouchScroller$3'),Ai=Jv(pC,'TouchScroller$4'),Bi=Jv(pC,'TouchScroller$5'),Di=Jv(pC,'TouchScroller$MomentumCommand'),Ci=Jv(pC,'TouchScroller$MomentumCommand$1'),Ei=Jv(pC,'TouchScroller$TemporalPoint'),Gi=Jv(qC,'Event$NativePreviewEvent'),Hi=Jv(qC,'Window$ClosingEvent'),Ii=Jv(qC,'Window$WindowHandlers'),Li=Jv(rC,'HistoryImpl'),Ki=Jv(rC,'HistoryImplTimer'),Ji=Jv(rC,'HistoryImplSafari'),Ti=Jv(kC,'ComplexPanel'),Mi=Jv(kC,'AbsolutePanel'),Pi=Jv(kC,'AttachDetachException'),Ni=Jv(kC,'AttachDetachException$1'),Oi=Jv(kC,'AttachDetachException$2'),Vi=Jv(kC,'FocusWidget'),Qi=Jv(kC,'ButtonBase'),Ri=Jv(kC,'Button'),Si=Jv(kC,'CellPanel'),Ui=Jv(kC,'DirectionalTextHelper'),Ck=Iv('[Lcom.google.gwt.user.client.ui.','Widget;'),_i=Jv(kC,'LabelBase'),aj=Jv(kC,'Label'),Wi=Jv(kC,'HTML'),Xi=Jv(kC,'HasHorizontalAlignment$AutoHorizontalAlignmentConstant'),Yi=Jv(kC,'HasHorizontalAlignment$HorizontalAlignmentConstant'),Zi=Jv(kC,'HasVerticalAlignment$VerticalAlignmentConstant'),$i=Jv(kC,'HorizontalPanel'),ak=Jv(lC,'AbstractList'),gk=Jv(lC,'ArrayList'),wk=Iv(EA,'[C'),cj=Jv(kC,'PopupPanel$1'),dj=Jv(kC,'PopupPanel$3'),ej=Jv(kC,'PopupPanel$4'),fj=Jv(kC,'PopupPanel$ResizeAnimation'),kj=Jv(kC,'RootPanel'),hj=Jv(kC,'RootPanel$1'),ij=Jv(kC,'RootPanel$2'),jj=Jv(kC,'RootPanel$DefaultRootPanel'),lj=Jv(kC,'ScrollPanel$Impl'),nj=Jv(kC,'SimplePanel$1'),qj=Jv(kC,'VerticalPanel'),sj=Jv(kC,'WidgetCollection'),rj=Jv(kC,'WidgetCollection$WidgetIterator'),xj=Jv(cC,'SimpleEventBus$1'),yj=Jv(cC,'SimpleEventBus$2'),zj=Jv(cC,'SimpleEventBus$3'),Gk=Iv(_B,'Throwable;'),Fj=Jv(YB,'Class'),Pj=Jv(YB,'StringBuffer'),Qj=Jv(YB,'StringBuilder'),Dk=Iv(_B,'Object;'),Zj=Jv(lC,'AbstractHashMap'),Wj=Jv(lC,'AbstractHashMap$EntrySet'),Vj=Jv(lC,'AbstractHashMap$EntrySetIterator'),dk=Jv(lC,'AbstractMapEntry'),Xj=Jv(lC,'AbstractHashMap$MapEntryNull'),Yj=Jv(lC,'AbstractHashMap$MapEntryString'),$j=Jv(lC,'AbstractList$IteratorImpl'),_j=Jv(lC,'AbstractList$ListIteratorImpl'),ck=Jv(lC,'AbstractMap$1'),bk=Jv(lC,'AbstractMap$1$1'),hk=Jv(lC,'Collections$EmptyList'),ik=Jv(lC,'Date'),jk=Jv(lC,'HashMap'),lk=Jv(lC,'MapEntryImpl'),rk=Jv(hC,'LogManager'),qk=Jv(hC,'LogManager$RootLogger'),uk=Jv(sC,'Sandbox$1'),vk=Jv(sC,'Sandbox$2');$stats && $stats({moduleName:'sandbox',sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalEnd'});if ($wnd.sandbox) $wnd.sandbox.onScriptLoad();
--></script></body></html>